com.ibm.commerce.registry
Class StoreRegistry

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

public class StoreRegistry
extends java.lang.Object
implements Registry

This is the StoreRegistry.


Field Summary
protected  java.util.Hashtable cache
           
protected  int cacheSize
           
protected static StoreRegistry singleton
           
 
Fields inherited from interface com.ibm.commerce.registry.Registry
COPYRIGHT
 
Constructor Summary
StoreRegistry()
          Store registry constructor.
 
Method Summary
 void addElement(java.lang.Integer storeId, StoreAccessBean bean)
          Adds a StoreAccessBeany to the cache.
 void addElement(java.lang.Integer storeId, StoreAccessBean bean, java.util.Hashtable aCache)
          Adds a StoreAccessBean to the given cache.
 StoreAccessBean find(java.lang.Integer storeId)
          This method will lookup a StoreAccessBean object from the local cache.
 int getStoreCount()
          Returns a count of all the stores defined.
 java.util.Enumeration getStoreElements()
          Returns an enumeration of all StoreAccessBeans stored in the store registry.
 void initialize()
          Initialize the store registry.
 void refresh()
          This method refresh the store access bean cache by retrieving all the store object from the database again.
 void removeAllElements()
          Removes all cached StoreAccessBean from cache.
 void removeElement(java.lang.Integer storeId)
          Removes a StoreAccessBean from the cache.
static StoreRegistry singleton()
          This method returns a singleton object of the store registry.
 
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 StoreRegistry singleton
Constructor Detail

StoreRegistry

public StoreRegistry()
Store registry constructor.
Method Detail

addElement

public void addElement(java.lang.Integer storeId,
                       StoreAccessBean bean)
Adds a StoreAccessBeany to the cache.
Parameters:
storeId - Integer
bean - StoreAccessBean

addElement

public void addElement(java.lang.Integer storeId,
                       StoreAccessBean bean,
                       java.util.Hashtable aCache)
Adds a StoreAccessBean to the given cache.
Parameters:
storeId - Integer
bean - StoreAccessBean
aCache - Hashtable

find

public StoreAccessBean find(java.lang.Integer storeId)
This method will lookup a StoreAccessBean object from the local cache.
Parameters:
storeId - Integer
Returns:
StoreAccessBean, null if store is not defined

getStoreCount

public int getStoreCount()
Returns a count of all the stores defined.
Returns:
int - store count

getStoreElements

public java.util.Enumeration getStoreElements()
Returns an enumeration of all StoreAccessBeans stored in the store registry.

Returns:
Enumeration - an enumeration of all StoreAccessBean

initialize

public void initialize()
                throws java.lang.Exception
Initialize the store registry.

Specified by:
initialize in interface Registry
Throws:
java.lang.Exception -  

refresh

public void refresh()
             throws java.lang.Exception
This method refresh the store access bean cache by retrieving all the store object from the database again.
Specified by:
refresh in interface Registry
Following copied from interface: com.ibm.commerce.registry.Registry
Throws:
-  

removeAllElements

public void removeAllElements()
Removes all cached StoreAccessBean from cache.

removeElement

public void removeElement(java.lang.Integer storeId)
Removes a StoreAccessBean from the cache.

Parameters:
storeId - Integer - the store entity id.

singleton

public static StoreRegistry singleton()
This method returns a singleton object of the store registry.
Returns:
StoreRegistry - a singleton StoreRegistry object