com.ibm.commerce.registry
Class LanguageRegistry

java.lang.Object
  |
  +--com.ibm.commerce.registry.LanguageRegistry
All Implemented Interfaces:
Registry

public class LanguageRegistry
extends java.lang.Object
implements Registry

This is the Language Registry.


Field Summary
protected  java.util.Hashtable cache
           
protected  int cacheSize
           
protected static LanguageRegistry singleton
           
 
Fields inherited from interface com.ibm.commerce.registry. Registry
COPYRIGHT
 
Constructor Summary
protected LanguageRegistry()
          Constructor for LanguageRegistry.
 
Method Summary
 void addElement(java.lang.Integer langId, java.lang.Object bean)
          Adds a LanguageAccessBean to the local cache.
 void addElement(java.lang.Integer langId, java.lang.Object bean, java.util.Hashtable aCache)
          Adds a LanguageAccessBean to the given cache.
 LanguageAccessBean find(java.lang.Integer langId)
          Finds a Langauge object from the Language registry.
 java.util.Enumeration getAll()
          Returns an Enumeration of all language Access Beans defined.
 java.lang.String getEncoding(java.lang.Integer langId)
          Returns the encoding string associated with a Langauge id.
 java.util.Locale getLocale(java.lang.Integer langId)
          Returns the locale associated with the Langauge object from the Language registry.
 void initialize()
          Initializes the LanguageRegistry.
 void refresh()
          Refreshes the local cache of lanaguage objects by retreiving them from the data base.
 void removeAllElements()
          Removes all LanguageAccessBean from the local cache.
 void removeElement(java.lang.Integer langId)
          Removes an LanguageAccessBean from the local cache.
static  LanguageRegistry singleton()
          Returns a singleton Language Registry object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected java.util.Hashtable cache

cacheSize

protected int cacheSize

singleton

protected static LanguageRegistry singleton
Constructor Detail

LanguageRegistry

protected LanguageRegistry()
Constructor for LanguageRegistry.
Method Detail

addElement

public void addElement(java.lang.Integer langId,
                       java.lang.Object bean)
Adds a LanguageAccessBean to the local cache.
Parameters:
langId - the language Id
bean - the LanguageAccessBean to be added to the local cache

addElement

public void addElement(java.lang.Integer langId,
                       java.lang.Object bean,
                       java.util.Hashtable aCache)
Adds a LanguageAccessBean to the given cache.
Parameters:
langId - the language Id
bean - the LanguageAccessBean to be added
aCache - the cache object to be used

find

public LanguageAccessBean find(java.lang.Integer langId)
Finds a Langauge object from the Language registry.
Parameters:
langId - language Id
Returns:
the LanguageAccessBean object

getAll

public java.util.Enumeration getAll()
Returns an Enumeration of all language Access Beans defined.
Returns:
an Enumeration of all LanguageAccessBean

getEncoding

public java.lang.String getEncoding(java.lang.Integer langId)
Returns the encoding string associated with a Langauge id.
Returns:
encoding string

getLocale

public java.util.Locale getLocale(java.lang.Integer langId)
Returns the locale associated with the Langauge object from the Language registry.
Returns:
the locale associated with the Langauge

initialize

public void initialize()
                throws java.lang.Exception
Initializes the LanguageRegistry. This will include the initialization of the WcsApp with this instance of the registry.
Specified by:
initialize in interface Registry
Throws:
java.lang.Exception

refresh

public void refresh()
             throws java.lang.Exception
Refreshes the local cache of lanaguage objects by retreiving them from the data base.
Specified by:
refresh in interface Registry
Throws:
java.lang.Exception

removeAllElements

public void removeAllElements()
Removes all LanguageAccessBean from the local cache.

removeElement

public void removeElement(java.lang.Integer langId)
Removes an LanguageAccessBean from the local cache.
Parameters:
langId - the language Id associated with the LanguageAccessBean

singleton

public static LanguageRegistry singleton()
Returns a singleton Language Registry object
Returns:
singleton LanguageRegistry object