Interface StateMachinePersister<S,E,T>
- Type Parameters:
S
- the type of stateE
- the type of eventT
- the type of context object
- All Known Implementing Classes:
AbstractStateMachinePersister
,DefaultStateMachinePersister
,RedisStateMachinePersister
public interface StateMachinePersister<S,E,T>
Interface persisting and restoring a
StateMachine
from
a persistent storage.-
Method Summary
Modifier and TypeMethodDescriptionvoid
persist
(StateMachine<S, E> stateMachine, T contextObj) Persist a state machine with a given context object.restore
(StateMachine<S, E> stateMachine, T contextObj) Reset a state machine with a given context object.
-
Method Details
-
persist
Persist a state machine with a given context object.- Parameters:
stateMachine
- the state machinecontextObj
- the context ojb- Throws:
Exception
- the exception in case or any persist error
-
restore
Reset a state machine with a given context object. Returned machine has been reseted and is ready to be used.- Parameters:
stateMachine
- the state machinecontextObj
- the context ojb- Returns:
- the state machine
- Throws:
Exception
- the exception in case or any persist error
-