com.ibm.commerce.registry
Class StoreRegistry

java.lang.Object
  |
  +--AbstractManagedDynamicCacheRegistry
        |
        +--com.ibm.commerce.registry.StoreRegistry

public class StoreRegistry
extends AbstractManagedDynamicCacheRegistry

The Store registry contains the runtime cache of StoreAccessBean objects.

See Also:
Serialized Form

Field Summary
protected static StoreRegistry singleton
           
protected  int storeSize
           
 
Constructor Summary
StoreRegistry()
          Store registry constructor.
 
Method Summary
 void addElement(java.lang.Integer storeId, StoreAccessBean bean, java.util.Hashtable aCache)
          Deprecated.  
 java.lang.Object createKey(java.lang.String strKey)
          Creates a cache key based on a key string
 java.lang.String createKeyString(com.ibm.commerce.datatype.TypedProperty prop)
          Creates a cache key based on input parameters
 StoreAccessBean find(java.lang.Integer storeId)
          Looks up a StoreAccessBean object from the store registry.
 int getStoreCount()
          Returns a count of all the stores defined.
 java.util.Enumeration getStoreElements()
          Deprecated.  
 void initialize()
          Initializes the store registry.
 boolean isStoreGroup(java.lang.Integer storeId)
          Check if an integer is a store group ID.
 void populate(LRUDynamicHashtable aCache)
          Populates the cache with store objects from the data base.
 java.lang.Object retrieve(java.lang.Object key)
          Retrieves a store object from the database and add it to the cache.
static  StoreRegistry singleton()
          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

singleton

protected static StoreRegistry singleton

storeSize

protected int storeSize
Constructor Detail

StoreRegistry

public StoreRegistry()
Store registry constructor.
Method Detail

createKeyString

public java.lang.String createKeyString(com.ibm.commerce.datatype.TypedProperty prop)
                                 throws java.lang.Exception
Creates a cache key based on input parameters
Parameters:
prop - The input property
Returns:
a cache key
Throws:
java.lang.Exception

createKey

public java.lang.Object createKey(java.lang.String strKey)
                           throws java.lang.Exception
Creates a cache key based on a key string
Parameters:
strKey - key as string
Returns:
a cache key
Throws:
java.lang.Exception

retrieve

public java.lang.Object retrieve(java.lang.Object key)
                          throws java.lang.Exception
Retrieves a store object from the database and add it to the cache.
Returns:
a store object
Throws:
java.lang.Exception

find

public StoreAccessBean find(java.lang.Integer storeId)
Looks up a StoreAccessBean object from the store registry. It will first check in the runtime cache, if not found, will retrieve it from the database.
Parameters:
storeId - store Id
Returns:
the StoreAccessBean or null if store is not defined

getStoreCount

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

getStoreElements

public java.util.Enumeration getStoreElements()
Deprecated.  
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
Initializes the store registry.
Throws:
java.lang.Exception

populate

public void populate(LRUDynamicHashtable aCache)
              throws java.lang.Exception
Populates the cache with store objects from the data base.
Parameters:
aCache - the cache to be populated
Throws:
java.lang.Exception

singleton

public static StoreRegistry singleton()
Returns a singleton object of the store registry.
Returns:
a singleton StoreRegistry object

addElement

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

isStoreGroup

public boolean isStoreGroup(java.lang.Integer storeId)
Check if an integer is a store group ID.
Parameters:
storeId - the integer to be checked.