com.opensymphony.xwork.config.impl
Class DefaultConfiguration

java.lang.Object
  extended by com.opensymphony.xwork.config.impl.DefaultConfiguration
All Implemented Interfaces:
Configuration

public class DefaultConfiguration
extends Object
implements Configuration

DefaultConfiguration

Version:
$Date: 2007-11-25 08:06:04 -0600 (Sun, 25 Nov 2007) $ $Id: DefaultConfiguration.java 1682 2007-11-25 14:06:04Z tm_jee $
Author:
Jason Carreira, tmjee

Field Summary
protected static org.apache.commons.logging.Log LOG
           
protected  RuntimeConfiguration runtimeConfiguration
           
 
Constructor Summary
DefaultConfiguration()
           
 
Method Summary
 void addPackageConfig(String name, PackageConfig packageContext)
          Add a PackageConfig with package name specified as name
protected  RuntimeConfiguration buildRuntimeConfiguration()
          This methodName builds the internal runtime configuration used by Xwork for finding and configuring Actions from the programmatic configuration data structures.
 void destroy()
          Allows the configuration to clean up any resources used
 PackageConfig getPackageConfig(String name)
          Return the PackageConfig (package configuration) for package with named as name
 Set getPackageConfigNames()
          Return the PackageConfigs name as a Set.
 Map getPackageConfigs()
          Return the PackageConfig as a Map with the key as the package name and its value as the corresponding PackageConfig
 String getParameter(String name)
          Return the configuration parameter value for with parameter name as name.
 Map getParameters()
          Return the configuration parameters in xwork.xml
 RuntimeConfiguration getRuntimeConfiguration()
          The current runtime configuration.
 void rebuildRuntimeConfiguration()
          Reload xwork configuration, once this is done, we need to grab the RuntimeConfiguration using getRuntimeConfiguration()
 void reload()
          Reload xwork configurations, by asking all of the ConfigurationProviders to reinitialize this DefaultConfiguration and then rebuildRuntimeConfiguration().
 void removePackageConfig(String name)
          Remove the PackageConfig for package with name as name.
 void setParameter(String name, String value)
          Set the configuration parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG

runtimeConfiguration

protected RuntimeConfiguration runtimeConfiguration
Constructor Detail

DefaultConfiguration

public DefaultConfiguration()
Method Detail

getParameters

public Map getParameters()
Return the configuration parameters in xwork.xml
    
      
         
         ....
      
      ....
    
 

Specified by:
getParameters in interface Configuration
Returns:
Map

getParameter

public String getParameter(String name)
Return the configuration parameter value for with parameter name as name.

Specified by:
getParameter in interface Configuration
Parameters:
name - parameter name
Returns:
String

setParameter

public void setParameter(String name,
                         String value)
Set the configuration parameter.

Specified by:
setParameter in interface Configuration
Parameters:
name - parameter name
value - parameter value

getPackageConfig

public PackageConfig getPackageConfig(String name)
Return the PackageConfig (package configuration) for package with named as name

Specified by:
getPackageConfig in interface Configuration
Parameters:
name - package name
Returns:
PackageConfig

getPackageConfigNames

public Set getPackageConfigNames()
Return the PackageConfigs name as a Set.

Specified by:
getPackageConfigNames in interface Configuration
Returns:
Set

getPackageConfigs

public Map getPackageConfigs()
Return the PackageConfig as a Map with the key as the package name and its value as the corresponding PackageConfig

Specified by:
getPackageConfigs in interface Configuration
Returns:
Map

getRuntimeConfiguration

public RuntimeConfiguration getRuntimeConfiguration()
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 get it using this method.

Specified by:
getRuntimeConfiguration in interface Configuration
Returns:
the current runtime configuration

addPackageConfig

public void addPackageConfig(String name,
                             PackageConfig packageContext)
Add a PackageConfig with package name specified as name

Specified by:
addPackageConfig in interface Configuration
Parameters:
name -
packageConfig -

destroy

public void destroy()
Allows the configuration to clean up any resources used

Specified by:
destroy in interface Configuration

rebuildRuntimeConfiguration

public void rebuildRuntimeConfiguration()
Reload xwork configuration, once this is done, we need to grab the RuntimeConfiguration using getRuntimeConfiguration()

Specified by:
rebuildRuntimeConfiguration in interface Configuration
Throws:
ConfigurationException

reload

public void reload()
            throws ConfigurationException
Reload xwork configurations, by asking all of the ConfigurationProviders to reinitialize this DefaultConfiguration and then rebuildRuntimeConfiguration().

Specified by:
reload in interface Configuration
Throws:
ConfigurationException

removePackageConfig

public void removePackageConfig(String name)
Remove the PackageConfig for package with name as name.

Specified by:
removePackageConfig in interface Configuration
Parameters:
name - package name to be removed

buildRuntimeConfiguration

protected RuntimeConfiguration buildRuntimeConfiguration()
                                                  throws ConfigurationException
This methodName 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.

Throws:
ConfigurationException

WebWork Project Page