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 |
addActionListener(ActionListener<S,E> listener)
Adds the action listener.
|
void |
addStateListener(StateListener<S,E> listener)
Adds the state listener.
|
reactor.core.publisher.Mono<java.lang.Void> |
entry(StateContext<S,E> context)
Initiate an entry sequence for the state.
|
reactor.core.publisher.Mono<java.lang.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<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> |
getEntryActions()
Gets
Action s executed entering in this state. |
java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> |
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<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> |
getStateActions()
Gets
Action s executed once in this 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 |
removeActionListener(ActionListener<S,E> listener)
Removes the action listener.
|
void |
removeStateListener(StateListener<S,E> listener)
Removes the state listener.
|
reactor.core.publisher.Flux<StateMachineEventResult<S,E>> |
sendEvent(org.springframework.messaging.Message<E> event)
Send an event
E wrapped with a Message to the state and
return a StateMachineEventResult for results. |
boolean |
shouldDefer(org.springframework.messaging.Message<E> event)
Checks if state wants to defer an event.
|
reactor.core.publisher.Flux<StateMachineEventResult<S,E>> sendEvent(org.springframework.messaging.Message<E> event)
E
wrapped with a Message
to the state and
return a StateMachineEventResult
for results.event
- the wrapped event to sendboolean shouldDefer(org.springframework.messaging.Message<E> event)
event
- the wrapped eventreactor.core.publisher.Mono<java.lang.Void> exit(StateContext<S,E> context)
context
- the state contextreactor.core.publisher.Mono<java.lang.Void> 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<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> getEntryActions()
Action
s executed entering in this state.java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> getStateActions()
Action
s executed once in this state.java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> 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 listenervoid addActionListener(ActionListener<S,E> listener)
listener
- the listenervoid removeActionListener(ActionListener<S,E> listener)
listener
- the listener