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

The CommandRegistry is the runtime cache of the CMDREG table.


Field Summary
protected static java.util.Hashtable cache
           
protected static CommandRegistry singleton
           
 
Fields inherited from interface com.ibm.commerce.registry. Registry
COPYRIGHT
 
Constructor Summary
CommandRegistry()
          Constructor for CommandRegistry.
 
Method Summary
 void addElement( CommandRegistryEntry regEntry)
          Adds a CommandRegistryEntry to the active cache.
 void addElement( CommandRegistryEntry regEntry, java.util.Hashtable aCache)
          Adds a CommandRegistryEntry to the cache object.
 java.lang.String createKey(java.lang.String name, java.lang.Integer storeId)
          Creates a search key.
  CommandRegistryEntry find(java.lang.String name, java.lang.Integer storeId)
          Looks up an command entry based on the name and store entity id.
 void initialize()
          Initializes the command registry.
 void refresh()
          Refreahes 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()
          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

singleton

protected static CommandRegistry singleton

cache

protected static java.util.Hashtable cache
Constructor Detail

CommandRegistry

public CommandRegistry()
Constructor for CommandRegistry.
Method Detail

addElement

public void addElement(CommandRegistryEntry regEntry)
Adds a CommandRegistryEntry to the active cache.
Parameters:
regEntry - the CommandRegistryEntry to be added to the cache

addElement

public void addElement(CommandRegistryEntry regEntry,
                       java.util.Hashtable aCache)
Adds a CommandRegistryEntry to the cache object.
Parameters:
regEntry - the CommandRegistryEntry to be added to the cache
aCache - a cache object

find

public CommandRegistryEntry find(java.lang.String name,
                                 java.lang.Integer storeId)
                          throws ECException
Looks up an command entry based on the name and store entity id. The store paths associated with this store's COMMAND resource will be used as the search path. If not founds, it will used the SITE profile store to look for the the command entry.
Parameters:
name - the interface name of the command
storeId - reference number of the store
Returns:
the command entry
Throws:
ECException - - generates _ERR_GENERIC error message

initialize

public void initialize()
                throws java.lang.Exception
Initializes the command registry.
Specified by:
initialize in interface Registry
Throws:
java.lang.Exception

refresh

public void refresh()
             throws java.lang.Exception
Refreahes 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 - the entry to be removed from the list

createKey

public java.lang.String createKey(java.lang.String name,
                                  java.lang.Integer storeId)
Creates a search key.
Parameters:
name - url name
storeId - store Id
Returns:
search key

singleton

public static CommandRegistry singleton()
Returns a singleton object of the command registry.
Returns:
a singleton CommandRegistry object