|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.clientcontroller.StateMachine
Manages the transition and navigation of the current state and its sub-states.
Constructor Summary | |
protected |
StateMachine(Transition anEntryTransition,
StateContext theParentContext)
Constructor which accepts an entry transition and the parent context. |
protected |
StateMachine(Transition anEntryTransition,
Transition anExitTransition,
StateContext theParentContext)
Constructor which accepts an entry and exit transition and the parent context. |
Method Summary | |
protected void |
cleanupState()
Recursively exit from the current state and state machine and all sub-states and sub-state machines. |
protected void |
cleanupSubState()
Recursively exit from all sub-states and sub-state machines. |
ContextView |
getContextView()
Returns a view of the current state's context. |
List |
getExternalEvents()
Retrieves a String list of all possible external events that
this state machine will react to. |
String |
getStateName()
Retrieve the heirarchical state name given the current state. |
List |
getValidExternalEvents()
Retrieve a String list of events based on transitions with
currently passable guard conditions. |
void |
handleEvent(String event,
Map arguments)
This is the client's interface method for event handling. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected StateMachine(Transition anEntryTransition, StateContext theParentContext)
protected StateMachine(Transition anEntryTransition, Transition anExitTransition, StateContext theParentContext)
Method Detail |
public ContextView getContextView()
public List getExternalEvents()
String
list of all possible external events that
this state machine will react to. If the current state contains an
embedded state machine, then its state is queried, and so on.
public List getValidExternalEvents()
String
list of events based on transitions with
currently passable guard conditions. This is based on the current state
and any sub-states.
public void handleEvent(String event, Map arguments)
handleExternalEvent
method.
handleEvent
also handles any exceptions passed by action
methods by putting the root state machine into an error state.
If the event is not handled, enter the error state. If any system related exceptions occur, they are reported and the state machine enters the error state.
protected void cleanupSubState() throws StateMachineException
StateMachineException
- if there is any problem processing the request. This might include a missing
key-value, application server problems, failed domain validation, or
data access errors.protected void cleanupState() throws StateMachineException
StateMachineException
- if there is any problem processing the request. This might include a missing
key-value, application server problems, failed domain validation, or
data access errors.public String getStateName()
state1~state2~state3
, for example, where state1 is
state2's parent, and state2 is state3's parent. The total state will be
from 1 to n layers deep.
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |