Package org.zkoss.fsm
Class MacroStateCtx<E,C,IN,E2,C2>
java.lang.Object
org.zkoss.fsm.StateCtx<E,C,IN>
org.zkoss.fsm.MacroStateCtx<E,C,IN,E2,C2>
The real power of StateMachine. This extended state allows you to define a
sub-StateMachine in a state. The life cycle of the inner state machine is
completely determined by the outer one:
1. Upon
StateCtx.onLand(IN, C, E) is called on the state,
StateMachine.start(Object) is triggered on the inner machine
2. Upon StateCtx.onReturn(IN, C) is called on the state,
StateMachine.run(Object) is triggered on the inner machine
3. Upon StateCtx.onLeave(IN, C, E) is called on the state, the inner machine
is terminated.
4. Upon StateCtx.onStop(boolean) is called on the state,
StateMachine.onStop(boolean) is triggered on the inner machine- Since:
- 6.0.0
- Author:
- simonpai
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.fsm.StateCtx
StateCtx.TransitionListener<IN,C> -
Field Summary
FieldsFields inherited from class org.zkoss.fsm.StateCtx
_machine, _minorReturners, _minorTransitionListeners, _minorTransitions, _returnAll, _returners, _transitionListeners, _transitions -
Constructor Summary
ConstructorsConstructorDescriptionMacroStateCtx(StateMachine<E2, C2, IN> submachine) Construct a macro state, which consists of a state machine by itself. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method is called when the machine enters this stateprotected voidThis method is called when the machine leaves this stateprotected voidThis method is called when the machine returns to the same stateprotected voidonStop(boolean endOfInput) This method is called when the machine stops on this stateMethods inherited from class org.zkoss.fsm.StateCtx
addMinorRoute, addMinorRoute, addMinorRoutes, addMinorRoutes, addMinorTransition, addMinorTransition, addMinorTransitions, addMinorTransitions, addReturningClasses, addReturningClasses, addReturningInputs, addReturningInputs, addRoute, addRoute, addRoutes, addRoutes, addTransition, addTransition, addTransitions, addTransitions, getDestination, init, isLeaving, isReturning, isReturningAll, onReject, setMaster, setReturningAll
-
Field Details
-
_submachine
-
-
Constructor Details
-
MacroStateCtx
Construct a macro state, which consists of a state machine by itself.
-
-
Method Details
-
onLand
Description copied from class:StateCtxThis method is called when the machine enters this state -
onReturn
Description copied from class:StateCtxThis method is called when the machine returns to the same state -
onLeave
Description copied from class:StateCtxThis method is called when the machine leaves this state -
onStop
protected void onStop(boolean endOfInput) Description copied from class:StateCtxThis method is called when the machine stops on this state
-