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
Modifier and TypeFieldDescriptionprotected Container
protected String
protected static final org.apache.logging.log4j.Logger
protected Map<String,
PackageConfig> protected RuntimeConfiguration
protected List<UnknownHandlerConfig>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPackageConfig
(String name, PackageConfig packageContext) static ContainerBuilder
bootstrapFactories
(ContainerBuilder builder) static ContainerBuilder
bootstrapTypeConverters
(ContainerBuilder builder) protected RuntimeConfiguration
This builds the internal runtime configuration used by Xwork for finding and configuring Actions from the programmatic configuration data structures.protected Container
createBootstrapContainer
(List<ContainerProvider> providers) void
destroy()
Allows the configuration to clean up any resources usedgetPackageConfig
(String name) The current runtime configuration.void
reloadContainer
(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 ActionContext
setContext
(Container cont) void
setUnknownHandlerStack
(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:
getPackageConfig
in interfaceConfiguration
-
getUnknownHandlerStack
- Specified by:
getUnknownHandlerStack
in interfaceConfiguration
- Returns:
- list of unknown handlers
-
setUnknownHandlerStack
- Specified by:
setUnknownHandlerStack
in interfaceConfiguration
- Parameters:
unknownHandlerStack
- list of unknown handlers
-
getPackageConfigNames
- Specified by:
getPackageConfigNames
in interfaceConfiguration
-
getPackageConfigs
- Specified by:
getPackageConfigs
in interfaceConfiguration
-
getLoadedFileNames
- Specified by:
getLoadedFileNames
in interfaceConfiguration
-
getRuntimeConfiguration
Description copied from interface:Configuration
The 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:
getRuntimeConfiguration
in interfaceConfiguration
- Returns:
- the current runtime configuration
-
getContainer
- Specified by:
getContainer
in interfaceConfiguration
- Returns:
- the container
-
addPackageConfig
- Specified by:
addPackageConfig
in interfaceConfiguration
-
removePackageConfig
Description copied from interface:Configuration
Removes a package from the the list of packages. Changes to the configuration won't take effect until buildRuntimeConfiguration is called.- Specified by:
removePackageConfig
in 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:
destroy
in interfaceConfiguration
-
rebuildRuntimeConfiguration
public void rebuildRuntimeConfiguration()- Specified by:
rebuildRuntimeConfiguration
in 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:
reloadContainer
in 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
ActionConfig
and combine its data with all inherited dast. For example, if theActionConfig
is in a package that contains a global result and it also contains a result, the resultingActionConfig
will have two results.- Returns:
- runtime configuration
- Throws:
ConfigurationException
- in case of any configuration errors
-