com.sdm.quasar.client.core.common.config.services
Class DefaultConfigProviderService

java.lang.Object
  extended bycom.sdm.quasar.client.core.common.config.services.DefaultConfigProviderService
All Implemented Interfaces:
ConfigProvider, ConfigProviderService, Service, SystemInfoProvider

public class DefaultConfigProviderService
extends java.lang.Object
implements ConfigProviderService, SystemInfoProvider

Version:
1.$Revision$
Author:
Thomas Wolf

Constructor Summary
DefaultConfigProviderService(ConfigProvider configProvider)
          Creates a new DefaultConfigProviderService.
 
Method Summary
 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.
 java.lang.Object getValue(java.lang.Class interfaceClass)
          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 interfaceClass)
          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

DefaultConfigProviderService

public DefaultConfigProviderService(ConfigProvider configProvider)
Creates a new DefaultConfigProviderService.

Method Detail

hasConfiguration

public boolean hasConfiguration(java.lang.Class configurationClass)
Description copied from interface: ConfigProvider
Returns true, if there is a Configuration stored under the given configuration key class.

Specified by:
hasConfiguration in interface ConfigProvider
See Also:
ConfigProvider.hasConfiguration(java.lang.Class)

getConfiguration

public Configuration getConfiguration(java.lang.Class configurationClass)
Description copied from interface: ConfigProvider
Returns the implementation for the given interface class.

Specified by:
getConfiguration in interface ConfigProvider
See Also:
ConfigProvider.getConfiguration(java.lang.Class)

getValue

public java.lang.Object getValue(java.lang.Class interfaceClass)
Description copied from interface: ConfigProvider
Returns the Object implementing a given interface. This can be used as a global registry for implementations that are not Services.

Specified by:
getValue in interface ConfigProvider
Parameters:
interfaceClass - the class of the interface
Returns:
the registered implementation corresponding to the interface or null if there is no implementation registered for that interface
See Also:
ConfigProvider.getValue(java.lang.Class)

getValue

public java.lang.Object getValue(java.lang.String key)
Description copied from interface: ConfigProvider
Returns the Object corresponding to the given configuration key. If the key is unknown, null will be returned. Values may be added using one of the add-methods of the ConfigManager.

Specified by:
getValue in interface ConfigProvider
Parameters:
key - the key to the configuration entry (not null)
Returns:
the value of the configuration entry, may be null.
See Also:
ConfigProvider.getValue(java.lang.String)

requireValue

public java.lang.Object requireValue(java.lang.Class interfaceClass)
Description copied from interface: ConfigProvider
Returns the Object implementing a given interface. In opposite to ConfigProvider.getValue(Class), throws an exception if the value is not contained.

Specified by:
requireValue in interface ConfigProvider
Parameters:
interfaceClass - the class of the interface
Returns:
the registered implementation corresponding to the interface
See Also:
ConfigProvider.requireValue(java.lang.Class)

collectSystemInfo

public void collectSystemInfo(SystemInfoNode root,
                              SystemInfoOptions options)
Description copied from interface: SystemInfoProvider
Builds the system information tree upon local information of the implementor. The system information tree can be used within development by inspecting the system; so implementors should append their internal state (depending on the details settings within SystemInfoOptions). 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.

Specified by:
collectSystemInfo in interface SystemInfoProvider
Parameters:
root - 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)
See Also:
SystemInfoProvider.collectSystemInfo(com.sdm.quasar.client.core.common.sysinfo.SystemInfoNode, com.sdm.quasar.client.core.common.sysinfo.SystemInfoOptions)