net.sf.xbus.base.core.config
Class PropertiesSource

java.lang.Object
  extended by net.sf.xbus.base.core.config.PropertiesSource
All Implemented Interfaces:
ConfigSource

public class PropertiesSource
extends java.lang.Object
implements ConfigSource

This is the implementation of a ConfigSource wich uses the Java-Properties.

To map the hierarchy of the Configuration, the keys of the properties must consist of three parts divided by "_" (e.g.System_MQ_Timeout).


Constructor Summary
PropertiesSource(java.lang.String source)
          The constructor builds the name of the properties-file: %XBUS_HOME%/etc/source.conf Program which uses this class must be started with: java -Dxbus.home="%XBUS_HOME%"
 
Method Summary
 java.util.Hashtable readCache()
          Reads the properties and fills a three-level hierarchie hashtable suitable for the Configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesSource

public PropertiesSource(java.lang.String source)
The constructor builds the name of the properties-file: %XBUS_HOME%/etc/source.conf

Program which uses this class must be started with: java -Dxbus.home="%XBUS_HOME%"

Parameters:
source - the property source
Throws:
XException - if any error occurs
Method Detail

readCache

public java.util.Hashtable readCache()
Reads the properties and fills a three-level hierarchie hashtable suitable for the Configuration.

Specified by:
readCache in interface ConfigSource
Returns:
Hashtable - three-level hierarchie hashtable
  1. level consists of the chapters as the keys and the hashtable as value
  2. level consists of the names of sections as the keys and a hashtable as value
  3. level consists of the name of keys and their values as Strings
Throws:
XException - if any error occurs