|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.btt.base.DSEHandler
com.ibm.btt.automaton.DSEState
public class DSEState
Implementation of a state inside the automaton.
The State will start processing the eventQueue after the entryActions are done. Note that after a suspend, abort or terminate method is invoked, the State WILL finish processing the current event's actions before stopping. If it is waiting for an event from the queue, it will stop waiting and return.
A suspended state will be sleeping for a period of SUSPENDTIME until it checks for the RunningModeFlag again. It can be woken up by calling the resume() method. A suspended State will wake up and exit when terminate or abort is called.
Field Summary | |
---|---|
static int |
ABORT_PROCESS
|
protected Vector |
actionHandlers
|
static int |
CHANGE_STATE
|
static java.lang.String |
CONDITIONS
|
static int |
CONTINUE
|
static java.lang.String |
DEFAULT_TYPE
|
protected boolean |
done
|
static java.lang.String |
ENTRY_ACTIONS
|
protected Vector |
entryActionsTags
|
static int |
EXECUTE_ACTION_AND_CHANGESTATE
|
static java.lang.String |
EXIT_ACTIONS
|
protected Vector |
exitActionsTags
|
protected java.lang.String |
exitEventName
|
static java.lang.String |
FINAL_TYPE
|
protected boolean |
ignoreEntryActions
|
static java.lang.String |
INITIAL_TYPE
|
protected java.lang.String |
name
|
static java.lang.String |
PAGE_TYPE
|
protected java.lang.Thread |
pqThread
|
protected Processor |
processor
|
protected boolean |
runningModeFlag
|
protected Hashtable |
sharedNotifiers
|
static int |
SKIP_ACTION
|
static int |
SKIP_ALL_ACTIONS
|
static int |
SKIP_CONDITIONS
|
static java.lang.String |
SUBFLOW_TYPE
|
protected java.lang.Thread |
suspendedThread
|
protected static int |
SUSPENDTIME
|
protected Tag |
tag
|
protected Hashtable |
transitions
|
static java.lang.String |
TRANSITIONS
|
protected java.lang.String |
type
|
static java.lang.String |
TYPE
|
static java.lang.String |
TYPE_ID_INFO
|
protected java.lang.String |
typeIdInfo
|
Constructor Summary | |
---|---|
DSEState()
|
Method Summary | |
---|---|
void |
abort()
Aborts the State. |
void |
activate()
Activates the State. |
protected boolean |
addHandlersForAction(Action action,
Vector triggers)
A utility method that adds handlers to the supplied Action object, using event names from the supplied triggers. |
Handler |
dispatchEvent(DSEEventObject anEvent)
Puts the event anEvent into a processor's event queue. |
protected void |
doEntryActions(Vector otherTrigs)
An internal routine for Activate() that executes the entryActions. |
protected void |
doExitActions()
An internal routine for Activate() that executes the exitActions. |
Externalizer |
externalizer()
This method gets the externalizer instance used to build. |
protected void |
fireDSEChangeStateEvent(java.lang.String targetStateName)
Calls the other fireDSEChangeStateEvent(String, boolean), passing in the targetStateName, and the default false for the isIgnoreEntryActions flag. |
protected void |
fireDSEChangeStateEvent(java.lang.String targetStateName,
java.lang.Boolean isIgnoreEntryActions)
Fires the internal DSEChangeStateEvent with a hashtable containing the values for the targetStateName and isIgnoreEntryActions. |
protected void |
fireDSEChangeStateEvent(java.lang.String targetStateName,
java.lang.Boolean isIgnoreEntryActions,
java.lang.Boolean isIgnoreExitActions)
Fires the internal DSEChangeStateEvent with a hashtable containing the values for the targetStateName, ignoreEntryActions and ignoreExitActions |
Vector |
getEntryActions()
Returns the vector of entryActionsTags. |
Vector |
getExitActions()
Returns the vector of exitActionsTags. |
protected int |
getGuardConditionResult(Action action,
GuardCondition condition)
Evaluates the guardcondition to true or false, and returns the appropriate constant int equavalent for the value of the flow modifier defined in the external file. |
Action |
getInstanceOfAction(Tag actionTag)
Returns an instance of the action from Tag actionTag by calling convertTagToObject(), which in turn calls initializeFrom(Tag). |
java.lang.String |
getName()
Returns the value of the State's name property. |
Processor |
getProcessor()
Returns the value of the processor property. |
Tag |
getTag()
Returns the value of the tag property. |
Hashtable |
getTransitions()
Returns the value of the transitions property. |
java.lang.String |
getType()
Returns the value of the State's type property. |
java.lang.String |
getTypeIdInfo()
Returns the value of the State's typeIdInfo property. |
java.lang.Object |
initializeFrom(Tag aTag)
This method begins by resetting the state attributes to null, so the state object can be reused, then the method uses the Tag of the current state to initialize a State with an Id, type, and the typeIdInfo. |
boolean |
isIgnoreEntryActions()
Returns the value of the ignoreEntryActions flag. |
boolean |
isRunningModeFlag()
Returns the value of the runningModeFlag property. |
protected void |
processEventQueue(Vector otherTrigs)
An internal routine for Activate() Loops and processes the eventQueue: -gets an event out of the eventQueue -checks to see if the event is changeState (if so, executes the change) -gets the transitions for the event -loops the actions for those transitions -instantiates the Action -chains or assigns its context -registers the Automaton's interest in events fired by the Action (IF there are any events) by adding the current State to its handlerslist -loops through any conditions the action may have, instantiating and evaluating each condition one by one -executes the action the loop is on -removes the handler and event(s) from its list IF it registered the Automaton's interest -unchains its context IF it was chained -closes the action -lastly, changes to the next state (by adding a "changeState" event to the queue) IF there is nothing else to do in this state (i.e. no more event/transition pairs to cycle through this method) AND there is a targetState specified in the last transition |
void |
readExternal()
This method will find the tag that corresponds to the name of THIS entity. |
void |
readExternal(java.io.ObjectInput in)
Invokes the object creation from an ObjectInput. |
void |
removeExternal()
Removes the Externalizer. |
protected boolean |
removeHandlersForAction(Action action)
This method removes the DSEState and DSEEvent pair that was added to the action's handlerslist when the action was created. |
protected boolean |
removeHandlersForAction(Action action,
Vector triggers)
Deprecated. Replaced by removeHandlersForAction(Action) . |
void |
resume()
Method to resume the processor. |
void |
setEntryActions(Vector newEntryActions)
Sets the value of the entryActions property. |
void |
setExitActions(Vector newExitActions)
Sets the value of the exitActions property. |
void |
setIgnoreEntryActions(boolean newIgnoreEntryActions)
Sets the value of the ignoreEntryActions flag. |
void |
setName(java.lang.String newName)
Sets the value of the name property. |
void |
setProcessor(Processor newProcessor)
Sets the value of the processor property. |
void |
setTag(Tag newTag)
Sets the value of the tag property. |
void |
setTransitions(Hashtable newTransitions)
Sets the value of the transitions property. |
void |
setType(java.lang.String newType)
Sets the value of the type property. |
void |
setTypeIdInfo(java.lang.String newTypeIdInfo)
Sets the value of the typeIdInfo property. |
protected Vector |
subscribeToShareNotifiers()
A subroutine for Activate(). |
void |
suspend()
Suspends the State. |
void |
terminate()
Provides a housekeeping process for the DSEState as a notifier instance. |
java.lang.String |
toString()
Returns a String representing the state. |
Vector |
toStrings()
Returns a Vector with the String representation of the object. |
Vector |
toTags()
Returns a Vector with the object represented as a Tag. |
protected void |
unsubscribeToSharedNotifiers()
Invoked to loop through the list of TransitionDescriptors and try to remove interest for the events generated by a Notifier or Service in the context. |
void |
writeExternal()
Writes this instance (converted into tags) to a file. |
void |
writeExternal(java.io.ObjectOutput out)
Provides concrete serialization handling for DSEState. |
Methods inherited from class com.ibm.btt.base.DSEHandler |
---|
handleEvent, handleEvent, stopHandlingEvent, stopHandlingEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ibm.btt.base.Handler |
---|
handleEvent, handleEvent, stopHandlingEvent, stopHandlingEvent |
Field Detail |
---|
protected boolean runningModeFlag
protected Processor processor
protected Vector entryActionsTags
protected Vector exitActionsTags
protected java.lang.String name
protected Hashtable transitions
public static final int CONTINUE
public static final int SKIP_CONDITIONS
public static final int SKIP_ACTION
public static final int SKIP_ALL_ACTIONS
public static final int ABORT_PROCESS
public static final int CHANGE_STATE
public static final int EXECUTE_ACTION_AND_CHANGESTATE
protected Tag tag
protected java.lang.Thread pqThread
protected boolean done
protected java.lang.Thread suspendedThread
protected static final int SUSPENDTIME
protected boolean ignoreEntryActions
public static final java.lang.String DEFAULT_TYPE
public static final java.lang.String PAGE_TYPE
public static final java.lang.String SUBFLOW_TYPE
public static final java.lang.String FINAL_TYPE
public static final java.lang.String INITIAL_TYPE
public static final java.lang.String TYPE
public static final java.lang.String TYPE_ID_INFO
public static final java.lang.String ENTRY_ACTIONS
public static final java.lang.String EXIT_ACTIONS
public static final java.lang.String CONDITIONS
public static final java.lang.String TRANSITIONS
protected java.lang.String type
protected java.lang.String typeIdInfo
protected java.lang.String exitEventName
protected Vector actionHandlers
protected Hashtable sharedNotifiers
Constructor Detail |
---|
public DSEState()
Method Detail |
---|
public void abort() throws DSEProcessorException
abort
in interface State
DSEProcessorException
public void activate() throws DSEInvalidArgumentException, DSEProcessorException
When it is suspended, a State will sleep for a SUSPENDTIME so that it will not hog up CPU time. It can be awakened by resume(), abort() or terminate().
activate
in interface State
DSEInvalidArgumentException
DSEProcessorException
protected boolean addHandlersForAction(Action action, Vector triggers)
action
- com.ibm.btt.html.automaton.Actiontriggers
- java.util.Vector
public Handler dispatchEvent(DSEEventObject anEvent)
anEvent contains relevant data to be used by the event handler held in a Hashtable, the source of the event and the event name. Any handler is responsible for implementing this method, to check if it is interested in the event and/or pass it to the next interested handler in the chain that is waiting for it.
If the method returns this, the notifier passes the event to the following handler in the chain waiting for it. If the method returns null, the event is not propagated.
The default event processing is to pass the event to the following handler.
dispatchEvent
in interface Handler
dispatchEvent
in class DSEHandler
anEvent
- BTTProcessorEventObject
protected void doEntryActions(Vector otherTrigs) throws DSEInvalidArgumentException, DSEProcessorException
triggerList
- com.ibm.btt.base.Vector
DSEInvalidArgumentException
DSEProcessorException
protected void doExitActions() throws DSEInvalidArgumentException, DSEProcessorException
DSEInvalidArgumentException
DSEProcessorException
public Externalizer externalizer() throws java.io.IOException
java.lang.IOException
java.io.IOException
protected void fireDSEChangeStateEvent(java.lang.String targetStateName) throws DSEProcessorException
targetStateName
- java.lang.String
DSEProcessorException
protected void fireDSEChangeStateEvent(java.lang.String targetStateName, java.lang.Boolean isIgnoreEntryActions) throws DSEProcessorException
targetStateName
- java.lang.String
DSEProcessorException
protected void fireDSEChangeStateEvent(java.lang.String targetStateName, java.lang.Boolean isIgnoreEntryActions, java.lang.Boolean isIgnoreExitActions) throws DSEProcessorException
targetStateName
- java.lang.StringisIgnoreEntryActions
- java.lang.BooleanisIgnoreExitActions
- java.lang.Boolean
DSEProcessorException
public Vector getEntryActions()
getEntryActions
in interface State
public Vector getExitActions()
protected int getGuardConditionResult(Action action, GuardCondition condition) throws DSEProcessorException
action
- com.ibm.btt.automaton.Actioncondition
- com.ibm.btt.automaton.GuardCondition
com.ibm.btt.base.DSEProcessorException
DSEProcessorException
public Action getInstanceOfAction(Tag actionTag) throws DSEProcessorException
actionTag
- com.ibm.btt.base.Tag
DSEProcessorException
public java.lang.String getName()
getName
in interface State
public Processor getProcessor()
getProcessor
in interface State
public Tag getTag()
public Hashtable getTransitions()
getTransitions
in interface State
public java.lang.String getType()
getType
in interface State
public java.lang.String getTypeIdInfo()
getTypeIdInfo
in interface State
public java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException, DSEException
initializeFrom
in interface State
aTag
- com.ibm.btt.base.Tag Contains the name and attributes of the
object to be created.
java.io.IOException
- The object can not be created.
DSEException
public boolean isIgnoreEntryActions()
public boolean isRunningModeFlag()
protected void processEventQueue(Vector otherTrigs) throws DSEInvalidArgumentException, DSEProcessorException
otherTrigs
- com.ibm.btt.base.Vector
DSEInvalidArgumentException
DSEProcessorException
public void readExternal() throws java.io.IOException
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- java.io.ObjectInput
java.io.IOException
java.lang.ClassNotFoundException
public void removeExternal() throws java.io.IOException
java.lang.IOException
java.io.IOException
protected boolean removeHandlersForAction(Action action)
action
- com.ibm.btt.automaton.Actiontriggers
- java.util.Vector
protected boolean removeHandlersForAction(Action action, Vector triggers)
removeHandlersForAction(Action)
.
action
- com.ibm.btt.automaton.Actiontriggers
- com.ibm.btt.base.Vector
public void resume()
resume
in interface State
public void setEntryActions(Vector newEntryActions)
setEntryActions
in interface State
newEntryActions
- com.ibm.btt.base.Vectorpublic void setExitActions(Vector newExitActions)
newEntryActions
- com.ibm.btt.base.Vectorpublic void setIgnoreEntryActions(boolean newIgnoreEntryActions)
setIgnoreEntryActions
in interface State
newIgnoreEntryActions
- booleanpublic void setName(java.lang.String newName)
setName
in interface State
newName
- java.lang.Stringpublic void setProcessor(Processor newProcessor)
setProcessor
in interface State
newProcessor
- com.ibm.btt.automaton.Processorpublic void setTag(Tag newTag)
newTag
- com.ibm.btt.base.Tagpublic void setTransitions(Hashtable newTransitions)
setTransitions
in interface State
newTransitions
- com.ibm.btt.base.Hashtablepublic void setType(java.lang.String newType)
setType
in interface State
newType
- java.lang.Stringpublic void setTypeIdInfo(java.lang.String newTypeIdInfo)
setTypeIdInfo
in interface State
newTypeIdInfo
- java.lang.Stringprotected Vector subscribeToShareNotifiers() throws DSEInvalidArgumentException
DSEInvalidArgumentException
public void suspend()
suspend
in interface State
public void terminate()
terminate
in interface State
public java.lang.String toString()
toString
in class java.lang.Object
public Vector toStrings()
public Vector toTags() throws java.io.IOException
java.io.IOException
protected void unsubscribeToSharedNotifiers()
public void writeExternal() throws java.io.IOException
java.io.IOException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- java.io.ObjectOutput
java.io.IOException
|
IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |