com.opensymphony.xwork2.config
Class ConfigurationManager

java.lang.Object
  extended by com.opensymphony.xwork2.config.ConfigurationManager

public class ConfigurationManager
extends java.lang.Object

ConfigurationManager - central for XWork Configuration management, including its ConfigurationProvider.

Version:
$Date: 2006-09-09 21:40:12 -0500 (Sat, 09 Sep 2006) $ $Id: ConfigurationManager.java 1123 2006-09-10 02:40:12Z mrdon $
Author:
Jason Carreira, tm_jee

Field Summary
protected  Configuration configuration
           
protected static org.apache.commons.logging.Log LOG
           
protected  java.util.concurrent.locks.Lock providerLock
           
 
Constructor Summary
ConfigurationManager()
           
 
Method Summary
 void addConfigurationProvider(ConfigurationProvider provider)
          adds a configuration provider to the List of ConfigurationProviders.
 void clearConfigurationProviders()
          clears the registered ConfigurationProviders.
 void conditionalReload()
          reloads the Configuration files if the configuration files indicate that they need to be reloaded.
 void destroyConfiguration()
           
 Configuration getConfiguration()
          Get the current XWork configuration object.
 java.util.List<ConfigurationProvider> getConfigurationProviders()
          Get the current list of ConfigurationProviders.
 void reload()
           
 void setConfiguration(Configuration configuration)
           
 void setConfigurationProviders(java.util.List<ConfigurationProvider> configurationProviders)
          Set the list of configuration providers
 
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

configuration

protected Configuration configuration

providerLock

protected java.util.concurrent.locks.Lock providerLock
Constructor Detail

ConfigurationManager

public ConfigurationManager()
Method Detail

getConfiguration

public Configuration getConfiguration()
Get the current XWork configuration object. By default an instance of DefaultConfiguration will be returned

See Also:
DefaultConfiguration

setConfiguration

public void setConfiguration(Configuration configuration)

getConfigurationProviders

public java.util.List<ConfigurationProvider> getConfigurationProviders()
Get the current list of ConfigurationProviders. If no custom ConfigurationProviders have been added, this method will return a list containing only the default ConfigurationProvider, XMLConfigurationProvider. if a custom ConfigurationProvider has been added, then the XmlConfigurationProvider must be added by hand.

TODO: the lazy instantiation of XmlConfigurationProvider should be refactored to be elsewhere. the behavior described above seems unintuitive.

Returns:
the list of registered ConfigurationProvider objects
See Also:
ConfigurationProvider

setConfigurationProviders

public void setConfigurationProviders(java.util.List<ConfigurationProvider> configurationProviders)
Set the list of configuration providers

Parameters:
configurationProviders -

addConfigurationProvider

public void addConfigurationProvider(ConfigurationProvider provider)
adds a configuration provider to the List of ConfigurationProviders. a given ConfigurationProvider may be added more than once

Parameters:
provider - the ConfigurationProvider to register

conditionalReload

public void conditionalReload()
reloads the Configuration files if the configuration files indicate that they need to be reloaded.

NOTE: FileManager could be configured through webwork.properties through webwork.configuration.xml.reload property.


reload

public void reload()

clearConfigurationProviders

public void clearConfigurationProviders()
clears the registered ConfigurationProviders. this method will call destroy() on each of the registered ConfigurationProviders

See Also:
ConfigurationProvider.destroy()

destroyConfiguration

public void destroyConfiguration()


Copyright © 2006 OpenSymphony. All Rights Reserved.