Allows for programmatic control of a state machines execution.
The *Now() family of methods move to a new
State immediately and let the new
State handle the current
Event .
The *Next() family on the other hand let the new
State handle the next
Event which is generated which make these method the
programmatic equivalent of using the
org.apache.mina.statemachine.annotation.Transition annotation.
Using the breakAndCall*() and breakAndReturn* methods one
can create sub state machines which behave very much like sub routines.
When calling a state the current state (or the specified returnTo
state) will be pushed on a stack. When returning from a state the last pushed
state will be popped from the stack and used as the new state.
author: The Apache MINA Project (dev@mina.apache.org) version: $Rev: 592122 $, $Date: 2007-11-05 12:10:32 -0700 (Mon, 05 Nov 2007) $
Method Summary
public static void
breakAndCallNext(String state) Breaks the execution of the current
Transition and lets the
State with the specified id handle the nextEvent .
Before moving to the new state the current state will be recorded.
public static void
breakAndCallNext(String state, String returnTo) Breaks the execution of the current
Transition and lets the
State with the specified id handle the nextEvent .
Before moving to the new state the current state will be recorded.
public static void
breakAndCallNow(String state) Breaks the execution of the current
Transition and lets the
State with the specified id handle the currentEvent .
Before moving to the new state the current state will be recorded.
public static void
breakAndCallNow(String state, String returnTo) Breaks the execution of the current
Transition and lets the
State with the specified id handle the currentEvent .
Before moving to the new state the current state will be recorded.
public static void breakAndCallNext(String state, String returnTo)(Code)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the nextEvent .
Before moving to the new state the current state will be recorded. The
next call to
StateControl.breakAndReturnNow() or
StateControl.breakAndReturnNext() will return to the specified returnTo state.
Parameters: state - the id of the State to call. Parameters: returnTo - the id of the State to return to.
breakAndCallNow
public static void breakAndCallNow(String state)(Code)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the currentEvent .
Before moving to the new state the current state will be recorded. The
next call to
StateControl.breakAndReturnNow() or
StateControl.breakAndReturnNext() will return to the specified returnTo state.
Parameters: state - the id of the State to call. Parameters: returnTo - the id of the State to return to.
Breaks the execution of the current
Transition and tries to
find another
Transition with higher weight or a
Transition of a parent
State which can handle the current
Event .
breakAndGotoNext
public static void breakAndGotoNext(String state)(Code)
public static void breakAndGotoNow(String state)(Code)
Breaks the execution of the current
Transition and lets the
State with the specified id handle the currentEvent .
Parameters: state - the id of the State to go to.