simple.http.connect
Class ConfiguratorFactory

java.lang.Object
  extended by simple.http.connect.ConfiguratorFactory

public final class ConfiguratorFactory
extends java.lang.Object

The ConfiguratorFactory retrives an instance of the Configurator interface, used to configure the connected TCP sockets. This is used to that a sinlge system wide configuration can be applied without changing any code. So, essentially it provides a pluggable configuration system.

In order to define a system wide implementation a property is needed to define the object. This uses the System properties to define the class name for the default instance. The property simple.http.connect.configurator is used to specify the implementation the server should use.

 java -Dsimple.http.connect.configurator=demo.DemoConfigurator
 
This will set the System property to the class name demo.DemoConfigurator. When the factory method getInstance is invoked it will return an implementation of this object or if the implementation cannot be loaded by the class loader a default implementation called DefaultConfigurator is returned instead.

Author:
Niall Gallagher

Constructor Summary
ConfiguratorFactory()
           
 
Method Summary
static Configurator getInstance()
          This produces the system wide Configurator to provide a uniform configuration for the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfiguratorFactory

public ConfiguratorFactory()
Method Detail

getInstance

public static Configurator getInstance()
This produces the system wide Configurator to provide a uniform configuration for the server. This uses a system property simple.http.connect.configurator to define the class name of the implementation that will be used for the system wide Configurator. This must contain the fully qualified class name of the implementation and should be loadable by this classes class loader. If the specified class cannot be loaded a default implementation is used called DefaultConfigurator.

Returns:
an implementation of the Configurator