public class PersistStateMachineHandler extends LifecycleObjectSupport
PersistStateMachineHandler
is a recipe which can be used to
handle a state change of an arbitrary entity in a persistent storage.Modifier and Type | Class and Description |
---|---|
static interface |
PersistStateMachineHandler.PersistStateChangeListener
The listener interface for receiving persistStateChange events.
|
Constructor and Description |
---|
PersistStateMachineHandler(StateMachine<java.lang.String,java.lang.String> stateMachine)
Instantiates a new persist state machine handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addPersistStateChangeListener(PersistStateMachineHandler.PersistStateChangeListener listener)
Adds the persist state change listener.
|
boolean |
handleEventWithState(org.springframework.messaging.Message<java.lang.String> event,
java.lang.String state)
Deprecated.
|
reactor.core.publisher.Mono<java.lang.Void> |
handleEventWithStateReactively(org.springframework.messaging.Message<java.lang.String> event,
java.lang.String state)
Handle event with entity reactively.
|
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
afterPropertiesSet, destroy, doDestroy, doPostStartReactively, doPostStopReactively, doPreStartReactively, doPreStopReactively, getBeanFactory, getPhase, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, start, startReactively, stop, stopReactively
public PersistStateMachineHandler(StateMachine<java.lang.String,java.lang.String> stateMachine)
stateMachine
- the state machineprotected void onInit() throws java.lang.Exception
LifecycleObjectSupport
InitializingBean
phase.onInit
in class LifecycleObjectSupport
java.lang.Exception
- exception@Deprecated public boolean handleEventWithState(org.springframework.messaging.Message<java.lang.String> event, java.lang.String state)
event
- the eventstate
- the statehandleEventWithStateReactively(Message, String)
public reactor.core.publisher.Mono<java.lang.Void> handleEventWithStateReactively(org.springframework.messaging.Message<java.lang.String> event, java.lang.String state)
event
- the eventstate
- the statepublic void addPersistStateChangeListener(PersistStateMachineHandler.PersistStateChangeListener listener)
listener
- the listener