org.jcoderz.commons.config
Interface ConfigurationCacheInterface

All Known Implementing Classes:
ConfigurationCacheByDbReadOnlyImpl, ConfigurationCacheByPropertiesImpl

public interface ConfigurationCacheInterface

ConfigurationCache Interface. This level is introduced to allow different cache implementations and backends. These are needed to reflect both development phases and newer technical approaches.


Method Summary
 void addConfigurationListener(ConfigurationListener newListener)
           
 Set getKeys()
          Returns an immutable Set containing all keys present in the configuration.
 String getString(String key)
          Returns the String value that is associated with the given key.
 void reloadCache()
          Reloads the internal configuration cache from resource bundle.
 

Method Detail

getString

String getString(String key)
                 throws ConfigurationValueNotFoundException,
                        ArgumentMalformedException
Returns the String value that is associated with the given key.

Parameters:
key - Configuration Key as string that is the key for a stored configuration value.
Returns:
the String value that is associated with the given key.
Throws:
ConfigurationValueNotFoundException - in case there is no match to the key.
ArgumentMalformedException - Is thrown to indicate the illegal use of a null object as input parameter.

getKeys

Set getKeys()
Returns an immutable Set containing all keys present in the configuration. The keys are ConfigurationKey objects. In case there are no keys, the Set is empty.

Returns:
the Set of all existing ConfigurationKey objects.

addConfigurationListener

void addConfigurationListener(ConfigurationListener newListener)
See Also:
ConfigurationServiceInterface.addConfigurationListener(ConfigurationListener)

reloadCache

void reloadCache()
Reloads the internal configuration cache from resource bundle. If an exception occurs during the reload, the old cached properties are returned.



Copyright 2007 The jCoderZ Project.