IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.cha.ejb
Class CHAInstanceMemoryFactory

java.lang.Object
  extended by com.ibm.btt.cha.ejb.CHAInstanceMemoryFactory

public class CHAInstanceMemoryFactory
extends java.lang.Object

This class is to manipulate remote context stored in memory and it works as a singleton.


Field Summary
static java.lang.String COPYRIGHT
           
 
Constructor Summary
CHAInstanceMemoryFactory()
          The constructor method of this class.
 
Method Summary
 void addNewContextInfo(java.lang.String instanceID)
           
 void cleanUp()
          Clean up memory
 void create(java.lang.String instanceID, java.lang.String contextName, java.lang.String typeName, boolean isRoot, Context aContext)
          Create a remote context.
 void deleteNewContextInfo(java.lang.String instanceID)
           
 Context getContext(java.lang.String instanceID)
          Get the context object according to the instanceID.
 java.lang.String getContextNamed(java.lang.String contextName)
          Searches the context tree from the root context for a context named aContextName
 java.util.Map getContextTable()
          Get the context table which is a hashtable.
static CHAInstanceMemoryFactory getInstance()
          Get the instance of this class.
 java.lang.String getLevel(java.lang.String instanceID)
          We can define an attribute --level-- in dsectxt.xml file to indicate level of the context.
static java.lang.String getRootContextInstanceID()
          Get the instance ID of the root context.
 boolean isNewContext(java.lang.String instanceID)
           
 boolean isReadOnly(java.lang.String instanceID)
          If the definition of this context in dsetxt.xml has the attribute readonly="true", this method will return true, otherwise, false is returned.
 boolean isRoot(java.lang.String instanceID)
          Judge if the context is a root context.
 Context newDynamicContext(java.lang.String contextName)
          Creates a new dynamic Local context with a supplied name.
 void removeContext(java.lang.String instanceID)
          Remove the context from hashtabe.
 void setContext(java.lang.String instanceID, Context aContext)
          Set a context object into the hashtable.
static void setRootContextInstanceID(java.lang.String string)
          Set the instance ID of the root context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Constructor Detail

CHAInstanceMemoryFactory

public CHAInstanceMemoryFactory()
The constructor method of this class.

Method Detail

getInstance

public static CHAInstanceMemoryFactory getInstance()
Get the instance of this class. The instance is unique per VM.

Returns:
the instance of this class.

create

public void create(java.lang.String instanceID,
                   java.lang.String contextName,
                   java.lang.String typeName,
                   boolean isRoot,
                   Context aContext)
            throws CHARemoteProcessException
Create a remote context. Root context can only be created once per CHA server.

Parameters:
instanceID -
parentID -
contextName -
typeName -
isRoot -
aContext -
Throws:
CHARemoteProcessException

getContext

public Context getContext(java.lang.String instanceID)
                   throws CHARemoteProcessException
Get the context object according to the instanceID.

Parameters:
instanceID -
Returns:
a context instance
Throws:
CHARemoteProcessException

setContext

public void setContext(java.lang.String instanceID,
                       Context aContext)
                throws CHARemoteProcessException
Set a context object into the hashtable.

Parameters:
instanceID -
aContext -
Throws:
CHARemoteProcessException

isRoot

public boolean isRoot(java.lang.String instanceID)
Judge if the context is a root context.

Parameters:
instanceID -
Returns:
true if the context is a root context.
Throws:
CHARemoteProcessException

removeContext

public void removeContext(java.lang.String instanceID)
                   throws CHARemoteProcessException
Remove the context from hashtabe.

Parameters:
instanceID - specifing the context
Throws:
CHARemoteProcessException

isReadOnly

public boolean isReadOnly(java.lang.String instanceID)
                   throws CHARemoteProcessException
If the definition of this context in dsetxt.xml has the attribute readonly="true", this method will return true, otherwise, false is returned.

Parameters:
instanceID -
Returns:
Throws:
CHARemoteProcessException

getLevel

public java.lang.String getLevel(java.lang.String instanceID)
                          throws CHARemoteProcessException
We can define an attribute --level-- in dsectxt.xml file to indicate level of the context. The context can be devided into three levels:root, session, normal.

Parameters:
instanceID -
Returns:
"root", "normal". If this attribute is not difined, return null ;
Throws:
CHARemoteProcessException

getRootContextInstanceID

public static java.lang.String getRootContextInstanceID()
Get the instance ID of the root context.

Returns:

setRootContextInstanceID

public static void setRootContextInstanceID(java.lang.String string)
Set the instance ID of the root context.

Parameters:
string -

newDynamicContext

public Context newDynamicContext(java.lang.String contextName)
                          throws CHARemoteProcessException
Creates a new dynamic Local context with a supplied name. The Context is created based on external definitions If the supplied name is given, it is created from the server-side external definitions. If no name is given, it will return null.

Parameters:
contextName -
location -
Returns:
Throws:
CHARemoteProcessException

getContextNamed

public java.lang.String getContextNamed(java.lang.String contextName)
                                 throws CHARemoteProcessException
Searches the context tree from the root context for a context named aContextName

Parameters:
contextName -
Returns:
Throws:
CHARemoteProcessException

getContextTable

public java.util.Map getContextTable()
Get the context table which is a hashtable. In this hashtable, the key is instanceID and the value is the context object.

Returns:
a hashtable

addNewContextInfo

public void addNewContextInfo(java.lang.String instanceID)
Parameters:
instanceID -
parentInstanceID -

deleteNewContextInfo

public void deleteNewContextInfo(java.lang.String instanceID)
Parameters:
instanceID -
parentInstanceID -

isNewContext

public boolean isNewContext(java.lang.String instanceID)
Parameters:
instanceID -
parentInstanceID -

cleanUp

public void cleanUp()
Clean up memory


IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008