com.sdm.quasar.client.core.common.config
Interface ConfigManager

All Superinterfaces:
ConfigProvider
All Known Implementing Classes:
DefaultConfigManager

public interface ConfigManager
extends ConfigProvider

Adds modification capabilities to the ConfigProvider.

Note: Implementations of this interface must be threadsafe.

Version:
1.0
Author:
Martin Haft, sd&m AG, Carsten Lucke, sd&m AG, Bernd Olleck, sd&m AG

Method Summary
 void addConfigurationDescription(ConfigurationDescriptor configurationDescriptor)
          Adds a ConfigurationDescriptor to this ConfigManager.
 void addValue(java.lang.Class keyClass, java.lang.Object value)
          Registers a global implementation for an interface.
 void addValue(java.lang.String key, java.lang.Object value)
          Adds a value to the configuration.
 void addValuesWithReader(ConfigReader configReader)
          Adds object values using the ConfigReader to the configuration.
 
Methods inherited from interface com.sdm.quasar.client.core.common.config.ConfigProvider
getConfiguration, getValue, getValue, hasConfiguration, requireValue
 

Method Detail

addValue

public void addValue(java.lang.String key,
                     java.lang.Object value)
Adds a value to the configuration. If the key has already a value assigned to, the old value will be replaced by the new value.

Parameters:
key - the key to the configuration entry
value - the value of the configuration entry, may be null.

addValue

public void addValue(java.lang.Class keyClass,
                     java.lang.Object value)
Registers a global implementation for an interface. The implementation is retrievable using ConfigProvider.getValue(Class).

Note The keyClass will be stored as full qualified class name.

Parameters:
keyClass - the key class
value - the implementation for the given key class

addConfigurationDescription

public void addConfigurationDescription(ConfigurationDescriptor configurationDescriptor)
Adds a ConfigurationDescriptor to this ConfigManager. In advantage to adding a simple key-value-mapping, ConfigurationDescriptors allow lazy instantiation of the configuration values.

Parameters:
configurationDescriptor - the ConfigurationDescriptor (not null)
Since:
Quasar Client 2.1

addValuesWithReader

public void addValuesWithReader(ConfigReader configReader)
                         throws java.io.IOException
Adds object values using the ConfigReader to the configuration.

Parameters:
configReader - the ConfigReader to be used for reading the file and creating the configuration value
Throws:
java.io.IOException - if an exception occurs while reading the file.