com.cgiams.esl.util
Class DataManagerFactory

java.lang.Object
  extended bycom.cgiams.esl.util.DataManagerFactory

public class DataManagerFactory
extends java.lang.Object

This factory class provides the ability to introduce multiple types of data access layers. If no specific DataManager object is specified, then the DefaultDataManagerImpl class is used.

One assumption that is made by this factory class is that any class implementing the DataManager interface must provide a public constructor that accepts a single String as argument. This string is assumed to be the configuration file name for the Data Access Layer.

Furthermore, it is up to the implementors of the DataManager interface to parse the incoming configuration file. Consquently, there is no required format for the configuration file. The format is determined completely by the implemenation classes of the DataManager interface.

Modification History
Programmer Date Description
Scott Bowers 04/06/2005 Original Author

Author:
sbowers

Method Summary
 DataManager getDataManager(java.lang.String as_config_file)
          Retrieves a new default DataManager object intialized by the incoming configuration file.
 DataManager getDataManager(java.lang.String as_manager_class_name, java.lang.String as_config_file)
          Creates a new DataManager instance for the given manager class name and initialized by the incoming SQL configuration file.
static DataManagerFactory getInstance()
          Method for returning this factory instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final DataManagerFactory getInstance()
Method for returning this factory instance.

Returns:
The Singleton instance of the DataManagerFactory.

getDataManager

public final DataManager getDataManager(java.lang.String as_config_file)
                                 throws java.lang.Exception
Retrieves a new default DataManager object intialized by the incoming configuration file.

Parameters:
as_config_file - The incoming SQL configuration file.
Returns:
A new DataManager instance.
Throws:
java.lang.Exception - If any error occurs.

getDataManager

public final DataManager getDataManager(java.lang.String as_manager_class_name,
                                        java.lang.String as_config_file)
                                 throws ESLException
Creates a new DataManager instance for the given manager class name and initialized by the incoming SQL configuration file.

Parameters:
as_manager_class_name - The fully qualified Java class name for an instance of the DataManager.
as_config_file - The incoming SQL configuration file.
Returns:
A new DataManager instance.
Throws:
ESLException - If any error occurs.