S
- the type of stateE
- the type of eventM
- the type of entitypublic abstract class RepositoryStateMachinePersist<M extends RepositoryStateMachine,S,E> extends java.lang.Object implements StateMachinePersist<S,E,java.lang.Object>
StateMachinePersist
using Spring Data Repositories.Modifier | Constructor and Description |
---|---|
protected |
RepositoryStateMachinePersist()
Instantiates a new repository state machine persist.
|
protected |
RepositoryStateMachinePersist(StateMachineSerialisationService<S,E> serialisationService)
Instantiates a new repository state machine persist.
|
Modifier and Type | Method and Description |
---|---|
protected abstract M |
build(StateMachineContext<S,E> context,
java.lang.Object contextObj,
byte[] serialisedContext)
Builds the generic
RepositoryStateMachine entity. |
protected abstract StateMachineRepository<M> |
getRepository()
Gets the repository.
|
StateMachineContext<S,E> |
read(java.lang.Object contextObj)
Read a
StateMachineContext from a persistent store
with a context object T . |
void |
write(StateMachineContext<S,E> context,
java.lang.Object contextObj)
Write a
StateMachineContext into a persistent store
with a context object T . |
protected RepositoryStateMachinePersist()
protected RepositoryStateMachinePersist(StateMachineSerialisationService<S,E> serialisationService)
serialisationService
- the serialisation servicepublic void write(StateMachineContext<S,E> context, java.lang.Object contextObj) throws java.lang.Exception
StateMachinePersist
StateMachineContext
into a persistent store
with a context object T
.write
in interface StateMachinePersist<S,E,java.lang.Object>
context
- the contextcontextObj
- the context ojbjava.lang.Exception
- the exceptionpublic StateMachineContext<S,E> read(java.lang.Object contextObj) throws java.lang.Exception
StateMachinePersist
StateMachineContext
from a persistent store
with a context object T
.read
in interface StateMachinePersist<S,E,java.lang.Object>
contextObj
- the context ojbjava.lang.Exception
- the exceptionprotected abstract StateMachineRepository<M> getRepository()
protected abstract M build(StateMachineContext<S,E> context, java.lang.Object contextObj, byte[] serialisedContext)
RepositoryStateMachine
entity.context
- the contextcontextObj
- the context objserialisedContext
- the serialised context