com.ibm.dse.automaton.html
Class HtmlProcessorManager

java.lang.Object
  |
  +--com.ibm.dse.base.DSEHandler
        |
        +--com.ibm.dse.automaton.ProcessorManager
              |
              +--com.ibm.dse.automaton.html.HtmlProcessorManager

public class HtmlProcessorManager
extends ProcessorManager

This class manages the creation, 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.
 
Fields inherited from class com.ibm.dse.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)
          This method retrieves the persistent data for the supplied processor id.
 Context getPersistentContext(java.lang.String sessionId, java.lang.String contextId)
          This method retrieves the persistent context for the supplied session id and context id.
 HtmlProcessorInfo getPersistentInfo(java.lang.String sessionId, java.lang.String processorId)
          This method retrieves the persistent data for the supplied processor id.
 java.util.Vector getProcessorIdsInSession(java.lang.String sessionId)
          This method returns a subSet of the processor registry which 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.
 boolean getSessionAffinity()
          Returns the value of the attribute sessionAffinity.
 boolean getSessionPersistence()
          Returns the value of the attribute sessionPersistence.
static HtmlProcessorManager getUniqueHTMLInstance()
          This method returns a singleton instance for the HTML Processor Manager.
 DSEHtmlProcessor loadProcessor(java.lang.String sessionId, java.lang.String processorId)
          This method restores a virtual processor object.
 DSEHtmlProcessor loadProcessorNonPersistent(java.lang.String sessionId, java.lang.String processorId)
          This method restores a virtual processor object from the tables stored in memory, associated to a session id.
 DSEHtmlProcessor loadProcessorPersistent(java.lang.String sessionId, java.lang.String processorId)
          This method restores a virtual processor object.
 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)
          This method unregisters a processor object by removing its saved data from storage.
 void removeProcessorNonPersistent(java.lang.String sessionId, java.lang.String processorId, boolean removeParentEntries)
          This method unregisters a processor object by removing its saved data from storage.
 void removeProcessorPersistent(java.lang.String sessionId, java.lang.String processorId, boolean removeParentEntries)
          This method unregisters a processor object by removing its saved data from storage.
 void removeProcessorsInSession(java.lang.String sessionId)
           
 void resetProcessorManager()
          This method aborts all the processors that are running and removes the reference in the processorRegistry.
 void resetProcessorManagerNonPersistent()
          This method aborts all the processors that are running and removes the reference in the processorRegistry.
 void resetProcessorManagerPersistent()
          Gets a registry of the processors ran under this session.
 void saveProcessor(java.lang.String sessionId, DSEHtmlProcessor processor)
          This method saves the information required to reinitialize the processor to the state it is in at the point that this method is called on it.
 void saveProcessorNonPersistent(java.lang.String sessionId, DSEHtmlProcessor processor)
          This method saves the information required to reinitialize the processor to the state it is in at the point that this method is called on it.
 void saveProcessorPersistent(java.lang.String sessionId, DSEHtmlProcessor processor)
          This method saves the information required to reinitialize the processor to the state it is in at the point that this method is called on it.
protected  void setSessionAffinity()
          Gets from the initialization file (dse.ini) 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 (dse.ini) the value of the tag initialization.sessionPersistence, and sets the value of the attribute sessionPersistence.
 void setSessionPersistence(boolean newSessionPersistence)
          Sets the value of the attribute sessionPersistence.
 
Methods inherited from class com.ibm.dse.automaton.ProcessorManager
abortProcessor, createProcessor, createProcessorFromCache, executeProcessor, getUniqueInstance, removeProcessor, resumeProcessor, setUniqueInstance, suspendProcessor
 
Methods inherited from class com.ibm.dse.base.DSEHandler
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.
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.dse.base.Vector

getInfo

public HtmlProcessorInfo getInfo(java.lang.String sessionId,
                                 java.lang.String processorId)
This method retrieves the persistent data for the supplied processor id.
Parameters:
processorId - java.lang.String
Returns:
com.ibm.dse.automaton.html.HtmlProcessorInfo

getPersistentContext

public Context getPersistentContext(java.lang.String sessionId,
                                    java.lang.String contextId)
This method retrieves the persistent context for the supplied session id and context id.
Parameters:
processorId - java.lang.String
Returns:
com.ibm.dse.automaton.html.HtmlProcessorInfo

getPersistentInfo

public HtmlProcessorInfo getPersistentInfo(java.lang.String sessionId,
                                           java.lang.String processorId)
This method retrieves the persistent data for the supplied processor id. It is specifical for a session persistent environment. Takes the data from the session object (DB) instead of memory.
Parameters:
processorId - java.lang.String
Returns:
com.ibm.dse.automaton.html.HtmlProcessorInfo

getProcessorIdsInSession

public java.util.Vector getProcessorIdsInSession(java.lang.String sessionId)
This method returns a subSet of the processor registry which 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.dse.base.Vector

getSessionAffinity

public boolean getSessionAffinity()
Returns the value of the attribute sessionAffinity. This method is specifical for HttpSession persistence.
Returns:
boolean

getSessionPersistence

public boolean getSessionPersistence()
Returns the value of the attribute sessionPersistence.
Returns:
boolean

getUniqueHTMLInstance

public static HtmlProcessorManager getUniqueHTMLInstance()
This method 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.dse.automaton.ProcessorManager

loadProcessor

public DSEHtmlProcessor loadProcessor(java.lang.String sessionId,
                                      java.lang.String processorId)
                               throws DSEInvalidArgumentException,
                                      DSEObjectNotFoundException
This method 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 data does not exist for the processor id supplied, then a null object is returned.
Parameters:
processId - java.lang.String
Returns:
com.ibm.dse.automaton.html.DSEHtmlProcessor
Throws:
com.ibm.dse.base.DSEInvalidArgumentException. -  
DSEObjectNotFoundException -  

loadProcessorNonPersistent

public DSEHtmlProcessor loadProcessorNonPersistent(java.lang.String sessionId,
                                                   java.lang.String processorId)
                                            throws DSEInvalidArgumentException,
                                                   DSEObjectNotFoundException
This method restores a virtual processor object from the tables stored in memory, associated to a session id.
Parameters:
processId - java.lang.String
Returns:
com.ibm.dse.automaton.html.DSEHtmlProcessor
Throws:
com.ibm.dse.base.DSEInvalidArgumentException. -  
DSEObjectNotFoundException -  

loadProcessorPersistent

public DSEHtmlProcessor loadProcessorPersistent(java.lang.String sessionId,
                                                java.lang.String processorId)
                                         throws DSEInvalidArgumentException,
                                                DSEObjectNotFoundException
This method restores a virtual processor object. The info is got from the session object (DB) instead of memory.
Parameters:
processId - java.lang.String
Returns:
com.ibm.dse.automaton.html.DSEHtmlProcessor
Throws:
com.ibm.dse.base.DSEInvalidArgumentException. -  
DSEObjectNotFoundException -  

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)
This method unregisters a processor object by removing its saved data from storage. If the boolean argument is true, then entries for all of the processor's parents will be removed as well. Depending on the session persistence configuration it will look 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)
This method unregisters a processor object by removing its saved data from storage. If the boolean argument is true, then entries for all of the processor's parents will be removed as well.
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)
This method unregisters a processor object by removing its saved data from storage. If the boolean argument is true, then entries for all of the processor's parents will be removed as well.
Parameters:
sessionId - java.lang.String
processorId - java.lang.String
removeParentEntries - boolean

removeProcessorsInSession

public void removeProcessorsInSession(java.lang.String sessionId)

resetProcessorManager

public void resetProcessorManager()
This method aborts all the processors that are running and removes the reference in the processorRegistry. Both the running and not running processors stored in the ProcessorInfoTable, and the contexts associated in the ContextTable are removed as well. Each session has an associated processors table, so it is needed to make all the process for each session.
Overrides:
resetProcessorManager in class ProcessorManager

resetProcessorManagerNonPersistent

public void resetProcessorManagerNonPersistent()
This method aborts all the processors that are running and removes the reference 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
This method saves the information required to reinitialize the processor to the state it is in at the point that this method is called on it.
Parameters:
sessionId - java.lang.String
processor - com.ibm.dse.automaton.html.DSEHtmlProcessor
Throws:
DSEInvalidArgumentException -  
DSEException -  

saveProcessorNonPersistent

public void saveProcessorNonPersistent(java.lang.String sessionId,
                                       DSEHtmlProcessor processor)
                                throws DSEInvalidArgumentException,
                                       DSEException
This method saves the information required to reinitialize the processor to the state it is in at the point that this method is called on it.
Parameters:
sessionId - java.lang.String
processor - com.ibm.dse.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
This method saves the information required to reinitialize the processor to the state it is in at the point that this method is called on it.
Parameters:
sessionId - java.lang.String
processor - com.ibm.dse.automaton.html.DSEHtmlProcessor
processorName - java.lang.String
processorState - java.lang.String
Throws:
DSEInvalidArgumentException -  
DSEException -  

setSessionAffinity

protected void setSessionAffinity()
Gets from the initialization file (dse.ini) 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 (dse.ini) the value of the tag initialization.sessionPersistence, and sets the value of the attribute sessionPersistence. If its value is "true" then the WSBCC assumes that the server is not configured to persist sessions. By default is "false". This method is specifical for HttpSession persistence.

setSessionPersistence

public void setSessionPersistence(boolean newSessionPersistence)
Sets the value of the attribute sessionPersistence.
Parameters:
newSessionPersistence - boolean