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)
Handle event with entity.
|
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
afterPropertiesSet, destroy, doDestroy, doStart, doStop, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, start, stop, stop
public PersistStateMachineHandler(StateMachine<java.lang.String,java.lang.String> stateMachine)
stateMachine
- the state machineprotected void onInit() throws java.lang.Exception
LifecycleObjectSupport
InitializingBean
phase. Implementor should
always call super method not to break initialization chain.onInit
in class LifecycleObjectSupport
java.lang.Exception
- exceptionpublic boolean handleEventWithState(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