com.ibm.commerce.registry
Class CommandRegistry

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

public class CommandRegistry
extends java.lang.Object
implements Registry

This is the CommandRegistry.


Field Summary
protected static java.util.Hashtable commandClCache
           
protected  java.util.Hashtable commandsByStore
           
protected static CommandRegistry singleton
           
 
Fields inherited from interface com.ibm.commerce.registry.Registry
COPYRIGHT
 
Constructor Summary
CommandRegistry()
          CommandRegistry constructor comment.
 
Method Summary
 void addElement(CommandRegistryEntry regEntry)
          Adds a CommandRegistryEntry to the active cache.
 void addElement(CommandRegistryEntry regEntry, java.util.Hashtable cache)
          Adds a CommandRegistryEntry to the cache object.
 CommandRegistryEntry find(java.lang.String name, java.lang.Integer storeId)
          This method will lookup a command entry by command interface name and store id.
 java.lang.String getKey(java.lang.String name, java.lang.Integer storeId)
          Returns a key for search given an interface name and a store Id.
 void initialize()
          Initialize the command registry.
 void refresh()
          This method refreah the command registry from the database.
 void removeAllElements()
          Removes all CommandRegistryEntries from the list.
 void removeElement(CommandRegistryEntry entry)
          Removes an CommandRegistryEntry from the list.
static CommandRegistry singleton()
          This method returns a singleton object of the command registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandClCache

protected static java.util.Hashtable commandClCache

commandsByStore

protected java.util.Hashtable commandsByStore

singleton

protected static CommandRegistry singleton
Constructor Detail

CommandRegistry

public CommandRegistry()
CommandRegistry constructor comment.
Method Detail

addElement

public void addElement(CommandRegistryEntry regEntry)
Adds a CommandRegistryEntry to the active cache. It does not add the CommandRegistryEntry to the database.
Parameters:
obj - the CommandRegistryEntry to be added to the list

addElement

public void addElement(CommandRegistryEntry regEntry,
                       java.util.Hashtable cache)
Adds a CommandRegistryEntry to the cache object.

Parameters:
obj - the CommandRegistryEntry to be added to the cahce object
cache - Hashtable - the cache object

find

public CommandRegistryEntry find(java.lang.String name,
                                 java.lang.Integer storeId)
This method will lookup a command entry by command interface name and store id. If the store id is null or if an entry cannot be found, it will return the entry with store id = ECConstants.EC_NO_STOREID
Parameters:
name - java.lang.String the interface name of the command
storeId - java.lang.Integer reference number of the store
Returns:
com.ibm.commerce.registry.CommandRegistryEntry

getKey

public java.lang.String getKey(java.lang.String name,
                               java.lang.Integer storeId)
Returns a key for search given an interface name and a store Id.

Parameters:
name - String - command interface name
storeId - Integer - store Id.
Returns:
String - search key

initialize

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

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

refresh

public void refresh()
             throws java.lang.Exception
This method refreah the command registry from the database.
Specified by:
refresh in interface Registry
Throws:
java.lang.Exception -  

removeAllElements

public void removeAllElements()
Removes all CommandRegistryEntries from the list. It does not remove the CommandRegistryEntries from the database.

removeElement

public void removeElement(CommandRegistryEntry entry)
Removes an CommandRegistryEntry from the list. It does not remove the CommandRegistryEntry from the database.
Parameters:
entry - CommandRegistryEntry - entry to be removed to the list

singleton

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