Package org.apache.struts2.config.impl
Class DefaultConfiguration
java.lang.Object
org.apache.struts2.config.impl.DefaultConfiguration
- All Implemented Interfaces:
Serializable,Configuration
DefaultConfiguration
- Author:
- Jason Carreira Created Feb 24, 2003 7:38:06 AM
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Containerprotected Stringprotected static final org.apache.logging.log4j.Loggerprotected Map<String,PackageConfig> protected RuntimeConfigurationprotected List<UnknownHandlerConfig> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPackageConfig(String name, PackageConfig packageContext) static ContainerBuilderbootstrapFactories(ContainerBuilder builder) static ContainerBuilderbootstrapTypeConverters(ContainerBuilder builder) protected RuntimeConfigurationThis builds the internal runtime configuration used by Xwork for finding and configuring Actions from the programmatic configuration data structures.protected ContainercreateBootstrapContainer(List<ContainerProvider> providers) voiddestroy()Allows the configuration to clean up any resources usedgetPackageConfig(String name) The current runtime configuration.voidreloadContainer(List<ContainerProvider> providers) Calls the ConfigurationProviderFactory.getConfig() to tell it to reload the configuration and then calls buildRuntimeConfiguration().removePackageConfig(String packageName) Removes a package from the the list of packages.protected ActionContextsetContext(Container cont) voidsetUnknownHandlerStack(List<UnknownHandlerConfig> unknownHandlerStack)
-
Field Details
-
BOOTSTRAP_CONSTANTS
-
LOG
protected static final org.apache.logging.log4j.Logger LOG -
packageContexts
-
runtimeConfiguration
-
container
-
defaultFrameworkBeanName
-
loadedFileNames
-
unknownHandlerStack
-
-
Constructor Details
-
DefaultConfiguration
public DefaultConfiguration() -
DefaultConfiguration
-
-
Method Details
-
getPackageConfig
- Specified by:
getPackageConfigin interfaceConfiguration
-
getUnknownHandlerStack
- Specified by:
getUnknownHandlerStackin interfaceConfiguration- Returns:
- list of unknown handlers
-
setUnknownHandlerStack
- Specified by:
setUnknownHandlerStackin interfaceConfiguration- Parameters:
unknownHandlerStack- list of unknown handlers
-
getPackageConfigNames
- Specified by:
getPackageConfigNamesin interfaceConfiguration
-
getPackageConfigs
- Specified by:
getPackageConfigsin interfaceConfiguration
-
getLoadedFileNames
- Specified by:
getLoadedFileNamesin interfaceConfiguration
-
getRuntimeConfiguration
Description copied from interface:ConfigurationThe current runtime configuration. Currently, if changes have been made to the Configuration since the last time buildRuntimeConfiguration() was called, you'll need to make sure to.- Specified by:
getRuntimeConfigurationin interfaceConfiguration- Returns:
- the current runtime configuration
-
getContainer
- Specified by:
getContainerin interfaceConfiguration- Returns:
- the container
-
addPackageConfig
- Specified by:
addPackageConfigin interfaceConfiguration
-
removePackageConfig
Description copied from interface:ConfigurationRemoves a package from the the list of packages. Changes to the configuration won't take effect until buildRuntimeConfiguration is called.- Specified by:
removePackageConfigin interfaceConfiguration- Parameters:
packageName- the name of the package to remove- Returns:
- the package removed (if any)
-
destroy
public void destroy()Allows the configuration to clean up any resources used- Specified by:
destroyin interfaceConfiguration
-
rebuildRuntimeConfiguration
public void rebuildRuntimeConfiguration()- Specified by:
rebuildRuntimeConfigurationin interfaceConfiguration
-
reloadContainer
public List<PackageProvider> reloadContainer(List<ContainerProvider> providers) throws ConfigurationException Calls the ConfigurationProviderFactory.getConfig() to tell it to reload the configuration and then calls buildRuntimeConfiguration().- Specified by:
reloadContainerin interfaceConfiguration- Parameters:
providers- list of ContainerProvider- Returns:
- list of package providers
- Throws:
ConfigurationException- in case of any configuration errors
-
setContext
-
createBootstrapContainer
-
bootstrapFactories
-
bootstrapTypeConverters
-
buildRuntimeConfiguration
This builds the internal runtime configuration used by Xwork for finding and configuring Actions from the programmatic configuration data structures. All of the old runtime configuration will be discarded and rebuilt.
It basically flattens the data structures to make the information easier to access. It will take an
ActionConfigand combine its data with all inherited dast. For example, if theActionConfigis in a package that contains a global result and it also contains a result, the resultingActionConfigwill have two results.- Returns:
- runtime configuration
- Throws:
ConfigurationException- in case of any configuration errors
-