S
- the type of stateE
- the type of eventpublic class RegionState<S,E> extends AbstractState<S,E>
State
implementation where states are wrapped in a regions..Constructor and Description |
---|
RegionState(S id,
java.util.Collection<Region<S,E>> regions)
Instantiates a new region state.
|
RegionState(S id,
java.util.Collection<Region<S,E>> regions,
java.util.Collection<E> deferred)
Instantiates a new region state.
|
RegionState(S id,
java.util.Collection<Region<S,E>> regions,
java.util.Collection<E> deferred,
java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> entryActions,
java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> exitActions)
Instantiates a new region state.
|
RegionState(S id,
java.util.Collection<Region<S,E>> regions,
java.util.Collection<E> deferred,
java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> entryActions,
java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> exitActions,
PseudoState<S,E> pseudoState)
Instantiates a new region state.
|
RegionState(S id,
java.util.Collection<Region<S,E>> regions,
PseudoState<S,E> pseudoState)
Instantiates a new region state.
|
Modifier and Type | Method and Description |
---|---|
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<S> |
getIds()
Gets the state identifiers.
|
java.util.Collection<State<S,E>> |
getStates()
Gets all possible states this state knows about including itself
and substates.
|
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. |
void |
setRegionExecutionPolicy(RegionExecutionPolicy regionExecutionPolicy)
Sets the region execution policy.
|
boolean |
shouldDefer(org.springframework.messaging.Message<E> event)
Checks if state wants to defer an event.
|
java.lang.String |
toString() |
addActionListener, addStateListener, armTriggers, disarmTriggers, doPreStartReactively, doPreStopReactively, executeAction, getDeferredEvents, getEntryActions, getExitActions, getId, getPseudoState, getRegions, getStateActions, getSubmachine, getTriggers, handleStateDoOnComplete, isComposite, isOrthogonal, isSimple, isSubmachineState, notifyStateOnComplete, removeActionListener, removeStateListener, setStateDoActionPolicy, setStateDoActionPolicyTimeout, setTriggers
afterPropertiesSet, destroy, doDestroy, doPostStartReactively, doPostStopReactively, getBeanFactory, getPhase, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, start, startReactively, stop, stopReactively
public RegionState(S id, java.util.Collection<Region<S,E>> regions)
id
- the state identifierregions
- the regionspublic RegionState(S id, java.util.Collection<Region<S,E>> regions, java.util.Collection<E> deferred)
id
- the state identifierregions
- the regionsdeferred
- the deferredpublic RegionState(S id, java.util.Collection<Region<S,E>> regions, PseudoState<S,E> pseudoState)
id
- the state identifierregions
- the regionspseudoState
- the pseudo statepublic RegionState(S id, java.util.Collection<Region<S,E>> regions, java.util.Collection<E> deferred, java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> entryActions, java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> exitActions, PseudoState<S,E> pseudoState)
id
- the state identifierregions
- the regionsdeferred
- the deferredentryActions
- the entry actionsexitActions
- the exit actionspseudoState
- the pseudo statepublic RegionState(S id, java.util.Collection<Region<S,E>> regions, java.util.Collection<E> deferred, java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> entryActions, java.util.Collection<java.util.function.Function<StateContext<S,E>,reactor.core.publisher.Mono<java.lang.Void>>> exitActions)
id
- the state identifierregions
- the regionsdeferred
- the deferredentryActions
- the entry actionsexitActions
- the exit actionspublic reactor.core.publisher.Flux<StateMachineEventResult<S,E>> sendEvent(org.springframework.messaging.Message<E> event)
State
E
wrapped with a Message
to the state and
return a StateMachineEventResult
for results.public boolean shouldDefer(org.springframework.messaging.Message<E> event)
State
shouldDefer
in interface State<S,E>
shouldDefer
in class AbstractState<S,E>
event
- the wrapped eventpublic reactor.core.publisher.Mono<java.lang.Void> exit(StateContext<S,E> context)
State
public reactor.core.publisher.Mono<java.lang.Void> entry(StateContext<S,E> context)
State
public java.util.Collection<S> getIds()
State
public java.util.Collection<State<S,E>> getStates()
State
public void setRegionExecutionPolicy(RegionExecutionPolicy regionExecutionPolicy)
regionExecutionPolicy
- the new region execution policypublic java.lang.String toString()
toString
in class AbstractState<S,E>