org.jboss.cache.config
Class XmlParsingConfigurationRegistry

java.lang.Object
  extended by org.jboss.cache.config.XmlParsingConfigurationRegistry
All Implemented Interfaces:
ConfigurationRegistry

public class XmlParsingConfigurationRegistry
extends Object
implements ConfigurationRegistry

ConfigurationRegistry that obtains its initial set of configurations by parsing an XML document.

Version:
$Revision: 7168 $
Author:
Brian Stansberry

Constructor Summary
XmlParsingConfigurationRegistry(String configResource)
           
 
Method Summary
 String getConfigResource()
           
 Configuration getConfiguration(String configName)
          Gets a clone of the Configuration registered under the given name.
 Set<String> getConfigurationNames()
          Gets the names of all registered configurations.
 void registerConfiguration(String configName, Configuration config)
          Register the given configuration under the given name.
 void start()
           
 void stop()
           
 void unregisterConfiguration(String configName)
          Unregisters the named configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlParsingConfigurationRegistry

public XmlParsingConfigurationRegistry(String configResource)
Method Detail

start

public void start()
           throws Exception
Throws:
Exception

stop

public void stop()

getConfigResource

public String getConfigResource()

getConfigurationNames

public Set<String> getConfigurationNames()
Description copied from interface: ConfigurationRegistry
Gets the names of all registered configurations.

Specified by:
getConfigurationNames in interface ConfigurationRegistry
Returns:
a set of configuration names

registerConfiguration

public void registerConfiguration(String configName,
                                  Configuration config)
                           throws CloneNotSupportedException
Description copied from interface: ConfigurationRegistry
Register the given configuration under the given name.

The configuration will be cloned before being stored internally, so the copy under the control of the registry will not be affected by any external changes.

Specified by:
registerConfiguration in interface ConfigurationRegistry
Parameters:
configName - the name of the configuration
config - the configuration
Throws:
CloneNotSupportedException

unregisterConfiguration

public void unregisterConfiguration(String configName)
Description copied from interface: ConfigurationRegistry
Unregisters the named configuration.

Specified by:
unregisterConfiguration in interface ConfigurationRegistry
Parameters:
configName - the name of the configuration

getConfiguration

public Configuration getConfiguration(String configName)
Description copied from interface: ConfigurationRegistry
Gets a clone of the Configuration registered under the given name.

The returned object is a clone of the internally held configuration, so any changes made to it by the caller will not affect the internal state of this registry.

Specified by:
getConfiguration in interface ConfigurationRegistry
Parameters:
configName - the name of the configuration
Returns:
a Configuration. Will not be null.


Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.