org.extex.framework.configuration
Class ConfigurationFactory

java.lang.Object
  extended by org.extex.framework.configuration.ConfigurationFactory

public class ConfigurationFactory
extends java.lang.Object

This is the factory for configurations.

The class to be used for the configuration can be set with the System.property named Util.Configuration.class. If this property is not set then the fallback class XmlConfiguration is used instead.

Version:
$Revision: 6802 $
Author:
Gerd Neugebauer

Method Summary
static Configuration newInstance(java.lang.String source)
          Delivers a new Configuration object which is initialized from a named source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static Configuration newInstance(java.lang.String source)
                                 throws ConfigurationException
Delivers a new Configuration object which is initialized from a named source. This source is usually a file name but can be anything else, like a URL or a reference to a database – depending on the underlying implementation.

The implementation can be specified in the system property Util.Configuration.class. The content is expected to be a fully qualified class name. This class has to implement the interface Configuration.

The default implementation is XmlConfiguration which uses an XML file located on the classpath.

Parameters:
source - the source of the configuration
Returns:
a new Configuration object
Throws:
ConfigurationException - in case of an error. Especially
  • ConfigurationInvalidNameException in case that the source is null
  • ConfigurationInstantiationException in case of some kind of error during instantiation
  • ConfigurationClassNotFoundException in case that the class could not be found
  • ConfigurationException in case that the creation of the Configuration fails