Class ZookeeperStateMachinePersist<S,E>
java.lang.Object
org.springframework.statemachine.zookeeper.ZookeeperStateMachinePersist<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
- All Implemented Interfaces:
StateMachinePersist<S,
E, org.apache.zookeeper.data.Stat>
public class ZookeeperStateMachinePersist<S,E>
extends Object
implements StateMachinePersist<S,E,org.apache.zookeeper.data.Stat>
StateMachinePersist
using zookeeper as a storage and
kroy libraries as a backing serialization technique.-
Constructor Summary
ConstructorsConstructorDescriptionZookeeperStateMachinePersist
(org.apache.curator.framework.CuratorFramework curatorClient, String path) Instantiates a new zookeeper state machine persist.ZookeeperStateMachinePersist
(org.apache.curator.framework.CuratorFramework curatorClient, String path, String logPath, int logSize) Instantiates a new zookeeper state machine persist. -
Method Summary
Modifier and TypeMethodDescriptionread
(org.apache.zookeeper.data.Stat stat) Read aStateMachineContext
from a persistent store with a context objectT
.readLog
(int version, org.apache.zookeeper.data.Stat stat) void
write
(StateMachineContext<S, E> context, org.apache.zookeeper.data.Stat stat) Write aStateMachineContext
into a persistent store with a context objectT
.
-
Constructor Details
-
ZookeeperStateMachinePersist
public ZookeeperStateMachinePersist(org.apache.curator.framework.CuratorFramework curatorClient, String path) Instantiates a new zookeeper state machine persist.- Parameters:
curatorClient
- the curator clientpath
- the path for persistent state
-
ZookeeperStateMachinePersist
public ZookeeperStateMachinePersist(org.apache.curator.framework.CuratorFramework curatorClient, String path, String logPath, int logSize) Instantiates a new zookeeper state machine persist.- Parameters:
curatorClient
- the curator clientpath
- the pathlogPath
- the log pathlogSize
- the log size
-
-
Method Details
-
write
Description copied from interface:StateMachinePersist
Write aStateMachineContext
into a persistent store with a context objectT
.- Specified by:
write
in interfaceStateMachinePersist<S,
E, org.apache.zookeeper.data.Stat> - Parameters:
context
- the contextstat
- the context ojb
-
read
Description copied from interface:StateMachinePersist
Read aStateMachineContext
from a persistent store with a context objectT
.- Specified by:
read
in interfaceStateMachinePersist<S,
E, org.apache.zookeeper.data.Stat> - Parameters:
stat
- the context ojb- Returns:
- the state machine context
- Throws:
Exception
- the exception
-
readLog
public StateMachineContext<S,E> readLog(int version, org.apache.zookeeper.data.Stat stat) throws Exception - Throws:
Exception
-