IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.automaton.html
Class HtmlProcessorManager

java.lang.Object
  extended by com.ibm.btt.base.BTTProcessorHandler
      extended by com.ibm.btt.automaton.ProcessorManager
          extended by com.ibm.btt.automaton.html.HtmlProcessorManager
All Implemented Interfaces:
ProcessorHandler

public class HtmlProcessorManager
extends ProcessorManager

This class manages creating, loading, and deleting of HTML processors. HTML processors can be persisted to and restored from storage and this class provides support for doing this. It also provides the traditional support for creating processors.


Field Summary
protected static java.lang.Object lockObject
          Static object used for synchronizing the access to the "instance" attribute in the getUniqueHTMLInstance method.
protected  boolean sessionAffinity
          Indicates whether the server configuration features session affinity.
protected  boolean sessionPersistence
          Indicates whether the server is configured to work under persistence conditions.
static java.lang.String STATE_CONTEXT_ID_SUBFIX
           *
 
Fields inherited from class com.ibm.btt.automaton.ProcessorManager
processorRegistry, uniqueInstance
 
Constructor Summary
HtmlProcessorManager()
          Constructor for the HtmlProcessorManager class.
 
Method Summary
static java.util.Hashtable getContextTable(java.lang.String sessionId)
          Returns the context table for the session ID supplied as argument.
 HtmlProcessorInfo getInfo(java.lang.String sessionId, java.lang.String processorId)
          Retrieves the persistent data for the supplied processor ID.
 Context getPersistentContext(java.lang.String sessionId, java.lang.String contextId)
          Retrieves the persistent context for the supplied session ID and context ID.
 HtmlProcessorInfo getPersistentInfo(java.lang.String sessionId, java.lang.String processorId)
          Retrieves the persistent data for the supplied processor ID.
 Context getPersistentStateContext(java.lang.String sessionId, java.lang.String stateContextTagID)
           Retrieves the persistent state context for the supplied session ID and statae context tag ID.
 java.util.Vector getProcessorIdsInSession(java.lang.String sessionId)
          Returns a subSet of the processor registry that contains all the processors which are running under a given session.
static java.util.Hashtable getProcessorInfoTable(java.lang.String sessionId)
          Returns the processor info table for the session ID supplied as argument.
static java.util.Hashtable getProcessorInfoTableForCheckSession(java.lang.String sessionId)
          Returns the processor info table for the session ID supplied as argument.
 boolean getSessionAffinity()
          Returns the value of the sessionAffinity property.
 boolean getSessionPersistence()
          Returns the value of the sessionPersistence property.
static HtmlProcessorManager getUniqueHTMLInstance()
          Returns a singleton instance for the HTML Processor Manager.
 DSEHtmlProcessor loadProcessor(java.lang.String sessionId, java.lang.String processorId)
          Restores a virtual processor object.
 DSEHtmlProcessor loadProcessorNonPersistent(java.lang.String sessionId, java.lang.String processorId)
          Restores the virtual processor object associated with the session ID from the tables stored in memory.
 DSEHtmlProcessor loadProcessorPersistent(java.lang.String sessionId, java.lang.String processorId)
          Restores a virtual processor object.
 void removePersistentContext(java.lang.String sessionId, java.lang.String contextId)
           Remove the persisted context
 void removePersistentStateContextTag(java.lang.String sessionId, java.lang.String stateContextTagID)
           Remove the persisted state context tag
 void removeProcessor(java.lang.String sessionId, java.lang.String processorId)
          This is equivalent to calling removeProcessor(String, String, boolean)
 void removeProcessor(java.lang.String sessionId, java.lang.String processorId, boolean removeParentEntries)
          Unregisters a processor object by removing its saved data from storage.
 void removeProcessorNonPersistent(java.lang.String sessionId, java.lang.String processorId, boolean removeParentEntries)
          Unregisters a processor object by removing its saved data from storage.
 void removeProcessorPersistent(java.lang.String sessionId, java.lang.String processorId, boolean removeParentEntries)
          Unregisters a processor object by removing its saved data from storage.
 void removeProcessorsInSession(java.lang.String sessionId)
           
 void resetProcessorManager()
          Aborts all the processors that are running and removes their references in the processorRegistry.
 void resetProcessorManagerNonPersistent()
          Aborts all the processors that are running and removes their references in the processorRegistry.
 void resetProcessorManagerPersistent()
          Gets a registry of the processors ran under this session.
 void saveProcessor(java.lang.String sessionId, DSEHtmlProcessor processor)
          Saves the information required to reinitialize the processor to its current state.
 void saveProcessorNonPersistent(java.lang.String sessionId, DSEHtmlProcessor processor)
          Saves the information required to reinitialize the processor to its current state.
 void saveProcessorPersistent(java.lang.String sessionId, DSEHtmlProcessor processor)
          Saves the information required to reinitialize the processor to its current state.
protected  void setSessionAffinity()
          Gets from the initialization file (btt.xml) the value of the tag initialization.sessionAffinity, and sets the value of the attribute sessionAffinity.
 void setSessionAffinity(boolean sessAffinity)
          Sets the value of the attribute sessionAffinity.
protected  void setSessionPersistence()
          Gets from the initialization file (btt.xml) the value of the initialization.sessionPersistence tag, and sets the value of the sessionPersistence property.
 void setSessionPersistence(boolean newSessionPersistence)
          Sets the value of the sessionPersistence property.
 
Methods inherited from class com.ibm.btt.automaton.ProcessorManager
abortProcessor, createProcessor, createProcessorFromCache, executeProcessor, getProcessorRegistry, getUniqueInstance, removeProcessor, resumeProcessor, setUniqueInstance, suspendProcessor
 
Methods inherited from class com.ibm.btt.base.BTTProcessorHandler
dispatchEvent, handleEvent, handleEvent, stopHandlingEvent, stopHandlingEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lockObject

protected static java.lang.Object lockObject
Static object used for synchronizing the access to the "instance" attribute in the getUniqueHTMLInstance method.


sessionAffinity

protected boolean sessionAffinity
Indicates whether the server configuration features session affinity. This attribute is specifical for HttpSession persistence.


sessionPersistence

protected boolean sessionPersistence
Indicates whether the server is configured to work under persistence conditions.


STATE_CONTEXT_ID_SUBFIX

public static java.lang.String STATE_CONTEXT_ID_SUBFIX
*

Constructor Detail

HtmlProcessorManager

public HtmlProcessorManager()
Constructor for the HtmlProcessorManager class. Sets the values for sesison persistence.

Method Detail

getContextTable

public static java.util.Hashtable getContextTable(java.lang.String sessionId)
Returns the context table for the session ID supplied as argument.

Parameters:
sessionId - java.lang.String
Returns:
com.ibm.btt.base.Vector

getInfo

public HtmlProcessorInfo getInfo(java.lang.String sessionId,
                                 java.lang.String processorId)
Retrieves the persistent data for the supplied processor ID.

Parameters:
processorId - java.lang.String
Returns:
com.ibm.btt.automaton.html.HtmlProcessorInfo

getPersistentContext

public Context getPersistentContext(java.lang.String sessionId,
                                    java.lang.String contextId)
Retrieves the persistent context for the supplied session ID and context ID.

Parameters:
processorId - java.lang.String
Returns:
com.ibm.btt.automaton.html.HtmlProcessorInfo

getPersistentStateContext

public Context getPersistentStateContext(java.lang.String sessionId,
                                         java.lang.String stateContextTagID)
Retrieves the persistent state context for the supplied session ID and statae context tag ID.

Parameters:
processorId - java.lang.String
Returns:
Context

getPersistentInfo

public HtmlProcessorInfo getPersistentInfo(java.lang.String sessionId,
                                           java.lang.String processorId)
Retrieves the persistent data for the supplied processor ID. It is specific for a session persistent environment. Takes the data from the session object (DB) instead of memory.

Parameters:
processorId - java.lang.String
Returns:
com.ibm.btt.automaton.html.HtmlProcessorInfo

getProcessorIdsInSession

public java.util.Vector getProcessorIdsInSession(java.lang.String sessionId)
Returns a subSet of the processor registry that contains all the processors which are running under a given session.

Parameters:
sessionId - java.lang.String
Returns:
java.util.Hashtable

getProcessorInfoTable

public static java.util.Hashtable getProcessorInfoTable(java.lang.String sessionId)
Returns the processor info table for the session ID supplied as argument.

Parameters:
sessionId - java.lang.String
Returns:
com.ibm.btt.base.Vector

getProcessorInfoTableForCheckSession

public static java.util.Hashtable getProcessorInfoTableForCheckSession(java.lang.String sessionId)
Returns the processor info table for the session ID supplied as argument.

Parameters:
sessionId - java.lang.String
Returns:
com.ibm.btt.base.Vector

getSessionAffinity

public boolean getSessionAffinity()
Returns the value of the sessionAffinity property. This method is specific for HttpSession persistence.

Returns:
boolean

getSessionPersistence

public boolean getSessionPersistence()
Returns the value of the sessionPersistence property.

Returns:
boolean

getUniqueHTMLInstance

public static HtmlProcessorManager getUniqueHTMLInstance()
Returns a singleton instance for the HTML Processor Manager. It should be called instead of getUniqueInstance(), which returns a singleton for the the superclass.

Returns:
com.ibm.btt.automaton.ProcessorManager

loadProcessor

public DSEHtmlProcessor loadProcessor(java.lang.String sessionId,
                                      java.lang.String processorId)
                               throws DSEInvalidArgumentException,
                                      DSEObjectNotFoundException
Restores a virtual processor object. The supplied processor ID is used to obtain the stored version of the processor object. This data is then used to recreate the processor object. If the data does not exist for the supplied processor ID, this method returns a null object.

Parameters:
processId - java.lang.String
Returns:
com.ibm.btt.automaton.html.DSEHtmlProcessor
Throws:
com.ibm.btt.base.DSEInvalidArgumentException.
DSEObjectNotFoundException
DSEInvalidArgumentException

loadProcessorNonPersistent

public DSEHtmlProcessor loadProcessorNonPersistent(java.lang.String sessionId,
                                                   java.lang.String processorId)
                                            throws DSEInvalidArgumentException,
                                                   DSEObjectNotFoundException
Restores the virtual processor object associated with the session ID from the tables stored in memory.

Parameters:
processId - java.lang.String
Returns:
com.ibm.btt.automaton.html.DSEHtmlProcessor
Throws:
com.ibm.btt.base.DSEInvalidArgumentException.
DSEObjectNotFoundException
DSEInvalidArgumentException

loadProcessorPersistent

public DSEHtmlProcessor loadProcessorPersistent(java.lang.String sessionId,
                                                java.lang.String processorId)
                                         throws DSEInvalidArgumentException,
                                                DSEObjectNotFoundException
Restores a virtual processor object. The info is obtained from the session object (DB) instead of memory.

Parameters:
processId - java.lang.String
Returns:
com.ibm.btt.automaton.html.DSEHtmlProcessor
Throws:
com.ibm.btt.base.DSEInvalidArgumentException.
DSEObjectNotFoundException
DSEInvalidArgumentException

removeProcessor

public void removeProcessor(java.lang.String sessionId,
                            java.lang.String processorId)
This is equivalent to calling removeProcessor(String, String, boolean)

Parameters:
sessionId - java.lang.String
processorId - java.lang.String

removeProcessor

public void removeProcessor(java.lang.String sessionId,
                            java.lang.String processorId,
                            boolean removeParentEntries)
Unregisters a processor object by removing its saved data from storage. If the boolean argument is true, entries for all of the processor's parents are also removed. Depending on the session persistence configuration, the method looks for the processor either in the memory table or in the session object (persistence).

Parameters:
sessionId - java.lang.String
processorId - java.lang.String
removeParentEntries - boolean

removeProcessorNonPersistent

public void removeProcessorNonPersistent(java.lang.String sessionId,
                                         java.lang.String processorId,
                                         boolean removeParentEntries)
Unregisters a processor object by removing its saved data from storage. If the boolean argument is true, entries for all of the processor's parents are also removed.

Parameters:
sessionId - java.lang.String
processorId - java.lang.String
removeParentEntries - boolean

removeProcessorPersistent

public void removeProcessorPersistent(java.lang.String sessionId,
                                      java.lang.String processorId,
                                      boolean removeParentEntries)
Unregisters a processor object by removing its saved data from storage. If the boolean argument is true, entries for all of the processor's parents are also removed.

Parameters:
sessionId - java.lang.String
processorId - java.lang.String
removeParentEntries - boolean

removeProcessorsInSession

public void removeProcessorsInSession(java.lang.String sessionId)

removePersistentContext

public void removePersistentContext(java.lang.String sessionId,
                                    java.lang.String contextId)
Remove the persisted context


removePersistentStateContextTag

public void removePersistentStateContextTag(java.lang.String sessionId,
                                            java.lang.String stateContextTagID)
Remove the persisted state context tag


resetProcessorManager

public void resetProcessorManager()
Aborts all the processors that are running and removes their references in the processorRegistry. Both the running and not running processors are stored in the ProcessorInfoTable, and the contexts associated in the ContextTable are removed as well. Each session has an associated processors table, so this table is needed to store all the process for each session.

Overrides:
resetProcessorManager in class ProcessorManager

resetProcessorManagerNonPersistent

public void resetProcessorManagerNonPersistent()
Aborts all the processors that are running and removes their references in the processorRegistry.


resetProcessorManagerPersistent

public void resetProcessorManagerPersistent()
Gets a registry of the processors ran under this session.


saveProcessor

public void saveProcessor(java.lang.String sessionId,
                          DSEHtmlProcessor processor)
                   throws DSEInvalidArgumentException,
                          DSEException
Saves the information required to reinitialize the processor to its current state.

Parameters:
sessionId - java.lang.String
processor - com.ibm.btt.automaton.html.DSEHtmlProcessor
Throws:
DSEInvalidArgumentException
DSEException

saveProcessorNonPersistent

public void saveProcessorNonPersistent(java.lang.String sessionId,
                                       DSEHtmlProcessor processor)
                                throws DSEInvalidArgumentException,
                                       DSEException
Saves the information required to reinitialize the processor to its current state.

Parameters:
sessionId - java.lang.String
processor - com.ibm.btt.automaton.html.DSEHtmlProcessor
processorName - java.lang.String
processorState - java.lang.String
Throws:
DSEInvalidArgumentException
DSEException

saveProcessorPersistent

public void saveProcessorPersistent(java.lang.String sessionId,
                                    DSEHtmlProcessor processor)
                             throws DSEInvalidArgumentException,
                                    DSEException
Saves the information required to reinitialize the processor to its current state.

Parameters:
sessionId - java.lang.String
processor - com.ibm.btt.automaton.html.DSEHtmlProcessor
processorName - java.lang.String
processorState - java.lang.String
Throws:
DSEInvalidArgumentException
DSEException

setSessionAffinity

protected void setSessionAffinity()
Gets from the initialization file (btt.xml) the value of the tag initialization.sessionAffinity, and sets the value of the attribute sessionAffinity. If its value is "false" then the WSBCC assumes that does not exist session affinity. By default is "true". This method is specifical for HttpSession persistence.


setSessionAffinity

public void setSessionAffinity(boolean sessAffinity)
Sets the value of the attribute sessionAffinity. This method is specifical for HttpSession persistence.

Parameters:
newSessionPersistence - boolean

setSessionPersistence

protected void setSessionPersistence()
Gets from the initialization file (btt.xml) the value of the initialization.sessionPersistence tag, and sets the value of the sessionPersistence property. If its value is true, the toolkit assumes that the server is not configured to persist sessions. By default, the property is set to false. This method is specifically for HttpSession persistence.


setSessionPersistence

public void setSessionPersistence(boolean newSessionPersistence)
Sets the value of the sessionPersistence property.

Parameters:
newSessionPersistence - boolean

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009