org.naftulin.configmgr
Interface ConfigurationManagement

All Known Implementing Classes:
ConfigurationManagementImpl

public interface ConfigurationManagement

Configuration Management provides a convinient way to manage configuration for your programs. Alows to load and reload configurations, add configuration, list all the configurations and returns configuration manager interface. Configuration manager interface returns configuration based on the key.

Since:
1.0
Author:
Henry Naftulin

Method Summary
 void addConfigurationManagmentEntry(ConfigurationManagementEntry entry)
          Adds a configuration management entry.
 ConfigurationManager getConfigurationManager()
          Returns configuration manager created by the configuration management engine.
 java.util.List<ConfigurationManagementEntry> getConfigurationManagmentEntries()
          Returns a list of configuration management entries managed by this configuration managment engine.
 ConfigurationManagementEntry getConfigurationManagmentEntry(java.lang.String key)
          Returns configuration management entry based on the key passed.
 boolean isInitialized()
          Returns true if configuration Management has loaded configurations.
 void reload()
          Reloades configurations stored in the configuration management engine.
 

Method Detail

getConfigurationManager

ConfigurationManager getConfigurationManager()
Returns configuration manager created by the configuration management engine.

Returns:
configuration manager.

reload

void reload()
            throws ConfigurationManagerException
Reloades configurations stored in the configuration management engine. The configurations are read again, parsed and stored.

Throws:
ConfigurationManagerException - if a problem occurs while reading or parsing the configurations.

getConfigurationManagmentEntry

ConfigurationManagementEntry getConfigurationManagmentEntry(java.lang.String key)
                                                            throws ConfigurationManagerException
Returns configuration management entry based on the key passed.

Parameters:
key - key the entry is stored under
Returns:
configuration management entry based on the key passed
Throws:
ConfigurationManagerException - if the entry is not found.

addConfigurationManagmentEntry

void addConfigurationManagmentEntry(ConfigurationManagementEntry entry)
                                    throws EntryInErrorException
Adds a configuration management entry. Entries added this way will be lost when the reload fucntionality is invoked.

Parameters:
entry - configuration managemet entry
Throws:
EntryInErrorException - if the entry is not configured properly, for example if the key is not supplied.

getConfigurationManagmentEntries

java.util.List<ConfigurationManagementEntry> getConfigurationManagmentEntries()
Returns a list of configuration management entries managed by this configuration managment engine.

Returns:
a list of configuration management entries managed by this configuration managment engine.

isInitialized

boolean isInitialized()
Returns true if configuration Management has loaded configurations. Returns false before that point. After instantiation, we can confgure where configuration master record is read from. Once the master record is configured, we will be able to reload configuration manager. Reloading configuration manager will load all configurations, and the flag will switch to initialized.

Returns:
true if configuration Management has loaded configurations.


Copyright © 2009. All Rights Reserved.