com.tomgibara.pronto.config
Class ConfigFactory

java.lang.Object
  extended by com.tomgibara.pronto.config.ConfigFactory
Direct Known Subclasses:
ConfigFactoryImpl

public abstract class ConfigFactory
extends java.lang.Object

Instances of this class are responsible for creating Config objects with which configuration settings can be exposed through Java interfaces.

Only one instance of a ConfigFactory is available through the getInstance() method. The default implementation returned by this static method can be changed by assigning the system property com.tomgibara.pronto.config.factory the name of a class which extends this abstract base class.

Author:
Tom Gibara

Constructor Summary
ConfigFactory()
           
 
Method Summary
static ConfigFactory getInstance()
          Should be called to obtain a ConfigFactory instance.
abstract  Config newConfig(ConfigSource source, java.lang.ClassLoader classLoader)
          Constructs a new config.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigFactory

public ConfigFactory()
Method Detail

getInstance

public static ConfigFactory getInstance()
                                 throws com.tomgibara.pronto.core.ProntoException
Should be called to obtain a ConfigFactory instance. This method is the single entry-point to configuration functionality in the pronto framework.

Returns:
the single instance of this factory
Throws:
com.tomgibara.pronto.core.ProntoException - if the factory instance could not be created

newConfig

public abstract Config newConfig(ConfigSource source,
                                 java.lang.ClassLoader classLoader)
                          throws ProntoConfigException
Constructs a new config.

Parameters:
source - the source of configuration properties, not null
classLoader - the class loader for creating interface implementations and value objects, may be null
Returns:
a new configuration object which draws its properties from the supplied source
Throws:
ProntoConfigException - if the properties could not be accessed and the policy is to throw exceptions


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.