Class AbstractTransition
java.lang.Object
org.apache.mina.statemachine.transition.AbstractTransition
- All Implemented Interfaces:
Transition
- Direct Known Subclasses:
MethodTransition, NoopTransition
Abstract
Transition implementation. Takes care of matching the
current Event's id against the id of the Event this
Transition handles. To handle any Event the id should be set
to Event.WILDCARD_EVENT_ID.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTransition(Object eventId) AbstractTransition(Object eventId, State nextState) AbstractTransition(State nextState) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanExecutes thisTransition.booleanbooleanExecutes thisTransition.inthashCode()toString()
-
Field Details
-
eventId
The accepted event ID -
nextState
The next state, if any
-
-
Constructor Details
-
AbstractTransition
-
AbstractTransition
-
AbstractTransition
-
AbstractTransition
-
-
Method Details
-
getNextState
- Specified by:
getNextStatein interfaceTransition- Returns:
- the
Statewhich theStateMachineshould move to if thisTransitionis taken andTransition.execute(Event)returnstrue.nullif thisTransitionis a loopbackTransition.
-
execute
Executes thisTransition. It is the responsibility of thisTransitionto determine whether it actually applies for the specifiedEvent. If thisTransitiondoesn't apply nothing should be executed andfalsemust be returned. The method will accept anyEventif it is registered with the wild card event ID ('*'), and the event ID it is declared for (ie, the event ID that has been passed as a parameter to this transition constructor.)- Specified by:
executein interfaceTransition- Parameters:
event- the currentEvent.- Returns:
trueif theTransitionwas executed,falseotherwise.
-
doExecute
Executes thisTransition. This method doesn't have to check if theEvent's id matches becauseexecute(Event)has already made sure that that is the case.- Parameters:
event- the currentEvent.- Returns:
trueif theTransitionhas been executed successfully and theStateMachineshould move to the nextState.falseotherwise.
-
equals
-
hashCode
-
toString
-