org.jlf.dataMap
Class DataLocationManager

java.lang.Object
  |
  +--org.jlf.dataMap.DataLocationManager

public class DataLocationManager
extends java.lang.Object

This class is used to find and cache DataLocation objects. A data location could be a JDBC data source, an XML file, a properties file, or any other source/sink of data.

See Also:
DataLocation, DataMapper, DataMappedObject

Field Summary
protected  java.util.Hashtable dataLocations
          Holds a cache of data locations
protected static int INITIAL_DATA_LOCATION_TABLE_SIZE
           
protected static DataLocationManager singleton
          Provides the class variable for the Singleton pattern, to keep track of the one and only instance of this class.
 
Constructor Summary
protected DataLocationManager()
          Protect the default constructor, this class uses a Singleton pattern.
 
Method Summary
static DataLocation getDataLocation(java.lang.String locationKey)
          Returns the singleton instance of this class.
protected  DataLocation getLocationForKey(java.lang.String locationKey)
          Retrieves a DataLocation for a key, checking the cache of locations to see if in there, if not, dispatching to to create a new one.
 void hashtableToProperties(java.util.Hashtable ht, java.util.Properties props)
          Helper method to convert all entries in the Hashtable (assuming they are ALL strings) into the Properties object given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_DATA_LOCATION_TABLE_SIZE

protected static final int INITIAL_DATA_LOCATION_TABLE_SIZE
See Also:
Constant Field Values

singleton

protected static DataLocationManager singleton
Provides the class variable for the Singleton pattern, to keep track of the one and only instance of this class.


dataLocations

protected java.util.Hashtable dataLocations
Holds a cache of data locations

Constructor Detail

DataLocationManager

protected DataLocationManager()
Protect the default constructor, this class uses a Singleton pattern. If you need to access the Singleton instance of the class, DON'T make this public, instead use the getInstance() method!

Method Detail

getDataLocation

public static DataLocation getDataLocation(java.lang.String locationKey)
Returns the singleton instance of this class.


hashtableToProperties

public void hashtableToProperties(java.util.Hashtable ht,
                                  java.util.Properties props)
Helper method to convert all entries in the Hashtable (assuming they are ALL strings) into the Properties object given.


getLocationForKey

protected DataLocation getLocationForKey(java.lang.String locationKey)
Retrieves a DataLocation for a key, checking the cache of locations to see if in there, if not, dispatching to to create a new one.