com.ibm.dse.automaton
Interface Processor

All Known Implementing Classes:
DSEProcessor

public interface Processor
extends Executable

The interface for a process which manages the flow of the business logic.


Field Summary
static java.lang.String COMPID
           
 
Method Summary
 void abort()
          This is invoked to abort the process.
 void addHandler(Handler aHandler, java.lang.String eventName)
          /** Adds a aHandler to the chain of handlers for the object implementing the Processor interface.
 void addProcessorStatusChangedListener(ProcessorStatusChangedListener param)
          Methods adds a listener to the processor's STATUSCHANGEEVENT and TERMINATEDEVENT.
 void changeState(java.lang.String newState, boolean changeStateIgnoringEntryActionsValue)
          This is invoked to change the state (by name) of the process.
 void close()
          This method is for closing actions and releasing the processor and context objects.
 Context getContext()
          Returns the value of the Context property.
 State getCurrentState()
          Return the CurrentState of the process.
 java.lang.String getCurrentStateType()
          Return the current State's Type.
 Queue getEventQueue()
          Returns the value of the eventQueue property.
 Hashtable getHandlersList()
          Returns a hastable containing the list of Handlers listening to this Process.
 Tag getInitialStateTag()
          This method returns the tag for the initial state .
 java.lang.String getProcessorId()
          Returns the value of the processorId property.
 java.lang.String getProcessorName()
          Returns the value of the processorName property.
 Tag getStateTag(java.lang.String stateName)
          This method returns the tag for the state name passed in as a parameter.
 Vector getStateTagList()
          Return a vector of states possible for this process.
 java.lang.String getStatus()
          Return the status of the process.
 Tag getTag()
          Return the tag associated with the process.
 void initialize()
          This initiates the process.
 void resume()
          This is invoked to resume a suspended processor.
 void setContext(Context aContext)
          Set the context to the process.
 void setCurrentState(State newState)
          Sets the value of the currentState property.
 void setCurrentStateType(java.lang.String newStateType)
          Sets the value of the CurrentStateType property.
 void setProcessorId(java.lang.String newProcessorId)
          Sets the value of the processorId property.
 void setProcessorName(java.lang.String externalizedId)
          Sets the value of the processorName property.
 void setStatus(java.lang.String aStatus)
          Set the status of the process.
 void setTag(Tag aTag)
          Set the tag of the process.
 void signalEvent(DSEEventObject anEvent)
          The operation must call the dispatch method of the first handler registered for this event, proceed according to the defined event propagation criteria, and follow the chain of handlers.
 void suspend()
          This is invoked to suspend the process.
 void terminate()
          Provides housekeeping for the Processor object as a notifier instance.
 
Methods inherited from interface com.ibm.dse.automaton.Executable
execute
 

Field Detail

COMPID

public static final java.lang.String COMPID
Method Detail

abort

public void abort()
           throws DSEProcessorException
This is invoked to abort the process.
Throws:
DSEProcessorException -  

addHandler

public void addHandler(Handler aHandler,
                       java.lang.String eventName)
                throws DSEInvalidArgumentException
/** Adds a aHandler to the chain of handlers for the object implementing the Processor interface.

The handler is located in the first position of the chain so it is the first handler to receive the event when signaled.

The handler, which is added to the chain of handlers using this operation, is registered for the event anEventName to be signaled by the DSENotifier. If it is interested in any event signaled by this notifier, then the event name must be set to allEvents. This method generates a DSEInvalidArgumentException when aHandler or anEventName are null.

Parameters:
aHandler - com.ibm.dse.base.Handler
eventName - java.lang.String
Throws:
DSEInvalidArgumentException -  

addProcessorStatusChangedListener

public void addProcessorStatusChangedListener(ProcessorStatusChangedListener param)
Methods adds a listener to the processor's STATUSCHANGEEVENT and TERMINATEDEVENT.
Parameters:
param - com.ibm.dse.automaton.ProcessorStatusChangedListener

changeState

public void changeState(java.lang.String newState,
                        boolean changeStateIgnoringEntryActionsValue)
                 throws DSEProcessorException
This is invoked to change the state (by name) of the process.
Parameters:
newState - java.lang.String
ignoreEntryActionsValue - boolean
Throws:
DSEProcessorException -  

close

public void close()
           throws DSEInvalidRequestException,
                  DSEObjectNotFoundException
This method is for closing actions and releasing the processor and context objects.
Throws:
DSEInvalidRequestException -  
DSEObjectNotFoundException -  

getContext

public Context getContext()
Returns the value of the Context property.
Returns:
com.ibm.dse.base.Context - the current instance of Context

getCurrentState

public State getCurrentState()
Return the CurrentState of the process.
Returns:
com.ibm.dse.automaton.State - the instance of the CurrentState

getCurrentStateType

public java.lang.String getCurrentStateType()
Return the current State's Type.
Returns:
java.lang.String

getEventQueue

public Queue getEventQueue()
Returns the value of the eventQueue property.
Returns:
com.ibm.dse.automaton.Queue

getHandlersList

public Hashtable getHandlersList()
Returns a hastable containing the list of Handlers listening to this Process.
Returns:
com.ibm.dse.base.Hashtable

getInitialStateTag

public Tag getInitialStateTag()
This method returns the tag for the initial state .
Returns:
com.ibm.dse.base.Tag

getProcessorId

public java.lang.String getProcessorId()
Returns the value of the processorId property.
Returns:
java.lang.String

getProcessorName

public java.lang.String getProcessorName()
Returns the value of the processorName property.
Returns:
java.lang.String

getStateTag

public Tag getStateTag(java.lang.String stateName)
This method returns the tag for the state name passed in as a parameter.
Parameters:
stateName - java.lang.String
Returns:
com.ibm.dse.base.Tag

getStateTagList

public Vector getStateTagList()
Return a vector of states possible for this process.
Returns:
com.ibm.dse.base.Vector

getStatus

public java.lang.String getStatus()
Return the status of the process.
Returns:
java.lang.String

getTag

public Tag getTag()
Return the tag associated with the process.
Returns:
com.ibm.dse.base.Tag

initialize

public void initialize()
                throws java.io.IOException,
                       DSEException
This initiates the process.
Throws:
java.io.IOException -  
DSEException -  
DSEProcessorException -  

resume

public void resume()
This is invoked to resume a suspended processor.

setContext

public void setContext(Context aContext)
Set the context to the process.
Parameters:
aContext - com.ibm.dse.base.Context

setCurrentState

public void setCurrentState(State newState)
Sets the value of the currentState property.
Parameters:
newState - State

setCurrentStateType

public void setCurrentStateType(java.lang.String newStateType)
Sets the value of the CurrentStateType property.
Parameters:
newStateType - java.lang.String

setProcessorId

public void setProcessorId(java.lang.String newProcessorId)
Sets the value of the processorId property.
Parameters:
newProcessorId - java.lang.String

setProcessorName

public void setProcessorName(java.lang.String externalizedId)
Sets the value of the processorName property.
Parameters:
externalizedId - java.lang.String

setStatus

public void setStatus(java.lang.String aStatus)
Set the status of the process.
Parameters:
aStatus - java.lang.String

setTag

public void setTag(Tag aTag)
Set the tag of the process.
Parameters:
aTag - com.ibm.dse.base.Tag

signalEvent

public void signalEvent(DSEEventObject anEvent)
The operation must call the dispatch method of the first handler registered for this event, proceed according to the defined event propagation criteria, and follow the chain of handlers. anEventName event contains, as attributes, as much information as is required to process it. The information is held in the params hashtable. Required notifier interface implementors must define themselves as a source of a standard Java event (that awakes all the listeners waiting for it). The signalEvent method can then be overwritten to add the statement that fires the event in the standard Java way. Additional methods to add and remove listeners must also be implemented as defined in the Java development guide.
Parameters:
param - com.ibm.dse.base.DSEEventObject

suspend

public void suspend()
This is invoked to suspend the process.

terminate

public void terminate()
               throws DSEException
Provides housekeeping for the Processor object as a notifier instance. This is called either from the application or from the context when it is destroyed or unchained. Subclasses should overwrite this implementation to perform the actions required to release the resources acquired by the notifier.
Throws:
DSEException -