com.ibm.commerce.registry
Class BusinessPolicyRegistry

java.lang.Object
  |
  +--com.ibm.commerce.registry.BusinessPolicyRegistry
All Implemented Interfaces:
Registry
Direct Known Subclasses:
BusinessPolicyCommandEntry

public class BusinessPolicyRegistry
extends java.lang.Object
implements Registry

BusinessPolicyRegistry is where the business policies are cached.


Inner Class Summary
 class BusinessPolicyRegistry.TypeAndStoreKey
           
 
Field Summary
protected static java.util.Hashtable policyByTypeAndStoreCache
           
protected static java.util.Hashtable policyCache
           
protected static java.util.Hashtable policyTypeCache
           
protected static BusinessPolicyRegistry singleton
           
 
Fields inherited from interface com.ibm.commerce.registry.Registry
COPYRIGHT
 
Constructor Summary
BusinessPolicyRegistry()
          BusinessPolicyRegistry constructor comment.
 
Method Summary
 BusinessPolicyAccessBean findPolicy(java.lang.String policyId)
          Returns the BusinessPolicyAccessBean with the given policyId
static java.lang.String getCommandClassNameFromInterface(java.lang.String commandInterfaceName)
          This method returns the default implementation of an interface.
 BusinessPolicyRegistryEntry getPolicyRegistryEntry(java.lang.String policyId)
          Returns the BusinessPolicyRegistryEntry associated with a policy Id
 BusinessPolicyRegistryEntry[] getPolicyRegistryEntryByTypeAndStore(java.lang.String asType, java.lang.Integer anStoreId)
          Returns the BusinessPolicyRegistryEntry by Type and Store
 void initialize()
          Initializes the BusinessPolicyRegistry.
 void refresh()
          This method refresh the view registry from the database.
 void refresh(java.lang.String policyId)
          This method refresh the registry entry for a particular policy id.
 void removeAllElements()
          Removes all Elements in this cache.
 boolean removeElement(BusinessPolicyRegistryEntry ta)
          Removes a BusinessPolicyRegistryEntry from the cache.
static BusinessPolicyRegistry singleton()
          This method returns a singleton BusinessPolicyRegistry object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

policyByTypeAndStoreCache

protected static java.util.Hashtable policyByTypeAndStoreCache

policyCache

protected static java.util.Hashtable policyCache

policyTypeCache

protected static java.util.Hashtable policyTypeCache

singleton

protected static BusinessPolicyRegistry singleton
Constructor Detail

BusinessPolicyRegistry

public BusinessPolicyRegistry()
BusinessPolicyRegistry constructor comment.
Method Detail

findPolicy

public BusinessPolicyAccessBean findPolicy(java.lang.String policyId)
                                    throws ECException
Returns the BusinessPolicyAccessBean with the given policyId
Parameters:
policyId - String
Returns:
BusinessPolicyAccessBean

getCommandClassNameFromInterface

public static java.lang.String getCommandClassNameFromInterface(java.lang.String commandInterfaceName)
This method returns the default implementation of an interface. The default implementation class name is defined by the field "defaultCommandClassName".

Returns:
String - default implementation class name if defined

getPolicyRegistryEntry

public BusinessPolicyRegistryEntry getPolicyRegistryEntry(java.lang.String policyId)
                                                   throws ECException
Returns the BusinessPolicyRegistryEntry associated with a policy Id
Parameters:
policyId - String
Returns:
BusinessPolicyRegistryEntry

getPolicyRegistryEntryByTypeAndStore

public BusinessPolicyRegistryEntry[] getPolicyRegistryEntryByTypeAndStore(java.lang.String asType,
                                                                          java.lang.Integer anStoreId)
                                                                   throws ECException
Returns the BusinessPolicyRegistryEntry by Type and Store
Parameters:
Type - String
StoreId - String
Returns:
BusinessPolicyRegistryEntry[]

initialize

public void initialize()
                throws java.lang.Exception
Initializes the BusinessPolicyRegistry. 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 refresh the view registry from the database.
Specified by:
refresh in interface Registry
Throws:
java.lang.Exception -  

refresh

public void refresh(java.lang.String policyId)
             throws java.lang.Exception
This method refresh the registry entry for a particular policy id.

Parameters:
policyId - String
Throws:
java.lang.Exception -  

removeAllElements

public void removeAllElements()
Removes all Elements in this cache.

removeElement

public boolean removeElement(BusinessPolicyRegistryEntry ta)
Removes a BusinessPolicyRegistryEntry from the cache.
Parameters:
obj - BusinessPolicyRegistryEntry - entry to be removed from cache.
Returns:
true if the BusinessPolicyRegistryEntry was removed or false if it was not

singleton

public static BusinessPolicyRegistry singleton()
This method returns a singleton BusinessPolicyRegistry object

Returns:
BusinessPolicyRegistry