VLab Common 1.1

pl.psnc.vlab.conf
Class ConfigFactory

java.lang.Object
  extended by pl.psnc.vlab.conf.ConfigFactory

public abstract class ConfigFactory
extends java.lang.Object

Abstract factory for retrieving the configuration object. The factory has to be initialised (see initConfig) before use.

Author:
Dominik Stoklosa (~osa~)
Email address
osa@man.poznan.pl

Field Summary
protected static java.lang.String configName
          default configuration name
 
Constructor Summary
ConfigFactory()
           
 
Method Summary
static Configuration getConfigFactory()
          Get an instance of the configuration object.
static Configuration getConfigFactory(java.lang.String cfgName)
          Get an instance of the configuration object
static void initConfig(java.lang.String configKey, Configuration configuration)
          Initialise the Configuration with the given configuration implementation and the given configuration key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configName

protected static java.lang.String configName
default configuration name

Constructor Detail

ConfigFactory

public ConfigFactory()
Method Detail

initConfig

public static void initConfig(java.lang.String configKey,
                              Configuration configuration)
Initialise the Configuration with the given configuration implementation and the given configuration key.

Parameters:
configKey - configuration key
configuration - configuration implementation

getConfigFactory

public static Configuration getConfigFactory()
                                      throws VlabException
Get an instance of the configuration object. NOTE !!! Do not use this method with more then one module at the same time, which are running at the same java virtual machine.

Returns:
configuration object
Throws:
VlabException - thrown when the configuration initialisation failed

getConfigFactory

public static Configuration getConfigFactory(java.lang.String cfgName)
                                      throws VlabException
Get an instance of the configuration object

Parameters:
cfgName - properties file with the configuration
Returns:
configuration object
Throws:
VlabException - thrown when the configuration initialisation failed

VLab Common 1.1

Copyright 2004 by VLAB Dominik Stoklosa.