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()
          Language registry constructor.
 
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)
          This method will lookup a Langauge object from the Language registry.
 java.util.Enumeration getAll()
          This method will return an Enumeration of all language Access Beans defined.
 java.lang.String getEncoding(java.lang.Integer langId)
          This method will return the encoding string associated with a Langauge id.
 java.util.Locale getLocale(java.lang.Integer langId)
          This method will return the locale associated with a Langauge object from the Language registry.
 void initialize()
          Initializes the LanguageRegistry.
 void refresh()
          This method freshes 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()
          This method 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()
Language registry constructor.
Method Detail

addElement

public void addElement(java.lang.Integer langId,
                       java.lang.Object bean)
Adds a LanguageAccessBean to the local cache.

Parameters:
langId - Integer the language Id
obj - 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 - Integer the language Id
obj - the LanguageAccessBean to be added
aCache - Hashtable the cache object to be used

find

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

getAll

public java.util.Enumeration getAll()
This method will return an Enumeration of all language Access Beans defined.
Returns:
Enumeration - an Enumeration of all LanguageAccessBean

getEncoding

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

getLocale

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

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

refresh

public void refresh()
             throws java.lang.Exception
This method freshes the local cache of lanaguage objects by retreiving them from the data base.
Specified by:
refresh in interface Registry
Following copied from interface: com.ibm.commerce.registry.Registry
Throws:
-  

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 - Integer the language Id associated with the LanguageAccessBean

singleton

public static LanguageRegistry singleton()
This method returns a singleton Language Registry object

Returns:
LanguageRegistry