|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sdm.quasar.client.core.common.config.DefaultConfigManager
Default implementation of a ConfigManager.
Possible extensions for further releases:
| Constructor Summary | |
DefaultConfigManager()
Creates a new DefaultConfigManager. |
|
DefaultConfigManager(ConfigProvider parent)
Creates a DefaultConfigManager using the given ConfigProvider as parent. |
|
DefaultConfigManager(ConfigProvider parent,
java.util.Map initialConfig)
Creates a DefaultConfigManager with initial configuration and using the
given ConfigProvider as parent. |
|
DefaultConfigManager(java.util.Map initialConfig)
Creates a DefaultConfigManager with initial configuration. |
|
| 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 |
addValuesFromMap(java.util.Map configMap)
Adds values from the given configuration Map.
|
void |
addValuesWithReader(ConfigReader configReader)
Adds object values using the ConfigReader to the configuration.
|
void |
collectSystemInfo(SystemInfoNode root,
SystemInfoOptions options)
Builds the system information tree upon local information of the implementor. |
Configuration |
getConfiguration(java.lang.Class configurationClass)
Returns the implementation for the given interface class. |
ConfigProvider |
getParent()
Returns the parent ConfigProvider or null, if no parent
exists. |
java.lang.Object |
getValue(java.lang.Class keyClass)
Returns the Object implementing a given interface. |
java.lang.Object |
getValue(java.lang.String key)
Returns the Object corresponding to the given configuration key. |
boolean |
hasConfiguration(java.lang.Class configurationClass)
Returns true, if there is a Configuration stored under the
given configuration key class. |
java.lang.Object |
requireValue(java.lang.Class keyClass)
Returns the Object implementing a given interface. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultConfigManager()
DefaultConfigManager.
public DefaultConfigManager(ConfigProvider parent)
DefaultConfigManager using the given ConfigProvider as parent.
parent - the parent ConfigProvider to use (not null)public DefaultConfigManager(java.util.Map initialConfig)
DefaultConfigManager with initial configuration.
initialConfig - the initial configuration parameters.
The keys must be either of type String or of type Class.
public DefaultConfigManager(ConfigProvider parent,
java.util.Map initialConfig)
DefaultConfigManager with initial configuration and using the
given ConfigProvider as parent.
parent - the parent ConfigProvider to use (not null)initialConfig - the initial configuration parameters.
The keys must be either of type String or of type Class.
Entries with key String will be available using getValue(java.lang.String)
and entrie with key Class will be available using getValue(java.lang.Class).| Method Detail |
public ConfigProvider getParent()
ConfigProvider or null, if no parent
exists.
public void addConfigurationDescription(ConfigurationDescriptor configurationDescriptor)
ConfigManagerConfigurationDescriptor to this ConfigManager.
In advantage to adding a simple key-value-mapping, ConfigurationDescriptors
allow lazy instantiation of the configuration values.
addConfigurationDescription in interface ConfigManagerconfigurationDescriptor - the ConfigurationDescriptor (not null)ConfigManager.addConfigurationDescription(com.sdm.quasar.client.core.common.config.ConfigurationDescriptor)public java.lang.Object getValue(java.lang.String key)
ConfigProviderConfigManager.
getValue in interface ConfigProviderkey - the key to the configuration entry (not null)
null.ConfigProvider.getValue(java.lang.String)public Configuration getConfiguration(java.lang.Class configurationClass)
ConfigProvider
getConfiguration in interface ConfigProviderConfigProvider.getConfiguration(java.lang.Class)public boolean hasConfiguration(java.lang.Class configurationClass)
ConfigProvidertrue, if there is a Configuration stored under the
given configuration key class.
hasConfiguration in interface ConfigProviderConfigProvider.hasConfiguration(java.lang.Class)public java.lang.Object getValue(java.lang.Class keyClass)
ConfigProviderServices.
getValue in interface ConfigProviderkeyClass - the class of the interface
null if there is no implementation registered for that interfaceConfigProvider.getValue(java.lang.Class)public java.lang.Object requireValue(java.lang.Class keyClass)
ConfigProviderConfigProvider.getValue(Class), throws an exception if the value
is not contained.
requireValue in interface ConfigProviderkeyClass - the class of the interface
ConfigProvider.requireValue(java.lang.Class)
public void addValue(java.lang.String key,
java.lang.Object value)
ConfigManager
addValue in interface ConfigManagerkey - the key to the configuration entryvalue - the value of the configuration entry, may be null.ConfigManager.addValue(java.lang.String, java.lang.Object)
public void addValue(java.lang.Class keyClass,
java.lang.Object value)
ConfigManagerConfigProvider.getValue(Class).
Note The keyClass will be stored as full qualified
class name.
addValue in interface ConfigManagerkeyClass - the key classvalue - the implementation for the given key classConfigManager.addValue(java.lang.Class, java.lang.Object)public void addValuesFromMap(java.util.Map configMap)
Map.
The keys must be either of type String or of type Class.
public void addValuesWithReader(ConfigReader configReader)
throws java.io.IOException
ConfigManagerConfigReader to the configuration.
addValuesWithReader in interface ConfigManagerconfigReader - the ConfigReader to be used for reading the file and
creating the configuration value
java.io.IOException - if an exception occurs while reading the file.ConfigManager.addValuesWithReader(com.sdm.quasar.client.core.common.config.ConfigReader)
public void collectSystemInfo(SystemInfoNode root,
SystemInfoOptions options)
SystemInfoProviderSystemInfoOptions).
The information can be appended to the tree by adding new child
SystemInformationNodes to the root node given using the
SystemInfoNode.createChild(String) method and by setting information
attributes the these nodes or the given root node.
collectSystemInfo in interface SystemInfoProviderroot - the SystemInfoNode to add information to (guaranteed to be not null)options - contains additional options, that might influence the amount of
information added to the tree (guaranteed to be not null)SystemInfoProvider.collectSystemInfo(com.sdm.quasar.client.core.common.sysinfo.SystemInfoNode, com.sdm.quasar.client.core.common.sysinfo.SystemInfoOptions)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||