name.angoca.db2sa
Class Configurator

Package class diagram package Configurator
java.lang.Object
  extended by name.angoca.db2sa.Configurator

public final class Configurator
extends Object

This class loads the configuration of the application. The implementation is with a singleton. The name of the configuration file is in a Constant (DB2SA_CONF_XML = db2sa_conf.xml)
This class defines all the default values in a set of constants; their names are in the Constants interface.
Control Version

Version:
1.0.0 2009-07-19
Author:
Andres Gomez Casanova (AngocA)

Method Summary
static void destroyInstance()
          Destroys the sole instance.
static Configurator getInstance()
          This is the singleton implementation.
 String getProperty(String key)
          Retrieves a property from the load properties.
 void setProperty(String key, String value)
          Set a property after the properties file has been read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Configurator getInstance()
This is the singleton implementation. This method returns the sole instance of this class.

Returns:
The sole instance of the Configurator class.

destroyInstance

public static void destroyInstance()
Destroys the sole instance. Useful for testing purposes.


getProperty

public String getProperty(String key)
Retrieves a property from the load properties.

Parameters:
key - Name of the property to load.
Returns:
Value of the property. Null if there is no value with that name.

setProperty

public void setProperty(String key,
                        String value)
Set a property after the properties file has been read. This is for testing purposes, because the configuration is not the same for all cases.

Parameters:
key - Name of the property.
value - Value of the property.


Andres Gomez Casanova (AngocA) Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.