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>

public class MacroStateCtx<E,C,IN,E2,C2> extends StateCtx<E,C,IN>
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
  • Field Details

  • Constructor Details

    • MacroStateCtx

      public MacroStateCtx(StateMachine<E2,C2,IN> submachine)
      Construct a macro state, which consists of a state machine by itself.
  • Method Details

    • onLand

      protected void onLand(IN input, C inputClass, E origin)
      Description copied from class: StateCtx
      This method is called when the machine enters this state
      Overrides:
      onLand in class StateCtx<E,C,IN>
    • onReturn

      protected void onReturn(IN input, C inputClass)
      Description copied from class: StateCtx
      This method is called when the machine returns to the same state
      Overrides:
      onReturn in class StateCtx<E,C,IN>
    • onLeave

      protected void onLeave(IN input, C inputClass, E destination)
      Description copied from class: StateCtx
      This method is called when the machine leaves this state
      Overrides:
      onLeave in class StateCtx<E,C,IN>
    • onStop

      protected void onStop(boolean endOfInput)
      Description copied from class: StateCtx
      This method is called when the machine stops on this state
      Overrides:
      onStop in class StateCtx<E,C,IN>