S
- the type of stateE
- the type of eventpublic interface State<S,E>
State
is an interface representing possible state in a state machine.Modifier and Type | Method and Description |
---|---|
void |
addStateListener(StateListener<S,E> listener)
Adds the state listener.
|
void |
entry(StateContext<S,E> context)
Initiate an entry sequence for the state.
|
void |
exit(StateContext<S,E> context)
Initiate an exit sequence for the state.
|
java.util.Collection<E> |
getDeferredEvents()
Gets the deferred events for this state.
|
java.util.Collection<? extends Action<S,E>> |
getEntryActions()
Gets
Action s executed entering in this state. |
java.util.Collection<? extends Action<S,E>> |
getExitActions()
Gets
Action s executed exiting from this state. |
S |
getId()
Gets the state identifier.
|
java.util.Collection<S> |
getIds()
Gets the state identifiers.
|
PseudoState<S,E> |
getPseudoState()
Gets a
PseudoState attached to a State . |
java.util.Collection<State<S,E>> |
getStates()
Gets all possible states this state knows about including itself
and substates.
|
boolean |
isComposite()
Checks if state is a composite state.
|
boolean |
isOrthogonal()
Checks if state is an orthogonal state.
|
boolean |
isSimple()
Checks if state is a simple state.
|
boolean |
isSubmachineState()
Checks if state is a submachine state.
|
void |
removeStateListener(StateListener<S,E> listener)
Removes the state listener.
|
boolean |
sendEvent(org.springframework.messaging.Message<E> event)
Send an event
E wrapped with a Message to the state. |
boolean |
shouldDefer(org.springframework.messaging.Message<E> event)
Checks if state wants to defer an event.
|
boolean sendEvent(org.springframework.messaging.Message<E> event)
E
wrapped with a Message
to the state.event
- the wrapped event to sendboolean shouldDefer(org.springframework.messaging.Message<E> event)
event
- the wrapped eventvoid exit(StateContext<S,E> context)
context
- the state contextvoid entry(StateContext<S,E> context)
context
- the state contextS getId()
java.util.Collection<S> getIds()
java.util.Collection<State<S,E>> getStates()
PseudoState<S,E> getPseudoState()
PseudoState
attached to a State
.
PseudoState
is not required and thus this method return
NULL
if it's not set.java.util.Collection<E> getDeferredEvents()
java.util.Collection<? extends Action<S,E>> getEntryActions()
Action
s executed entering in this state.java.util.Collection<? extends Action<S,E>> getExitActions()
Action
s executed exiting from this state.boolean isSimple()
boolean isComposite()
boolean isOrthogonal()
TRUE
,
isComposite()
will also always return TRUE
.boolean isSubmachineState()
void addStateListener(StateListener<S,E> listener)
listener
- the listenervoid removeStateListener(StateListener<S,E> listener)
listener
- the listener