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 aStateMachineContextfrom a persistent store with a context objectT.readLog(int version, org.apache.zookeeper.data.Stat stat) voidwrite(StateMachineContext<S, E> context, org.apache.zookeeper.data.Stat stat) Write aStateMachineContextinto 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:StateMachinePersistWrite aStateMachineContextinto a persistent store with a context objectT.- Specified by:
writein interfaceStateMachinePersist<S,E, org.apache.zookeeper.data.Stat> - Parameters:
context- the contextstat- the context ojb
-
read
Description copied from interface:StateMachinePersistRead aStateMachineContextfrom a persistent store with a context objectT.- Specified by:
readin 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
-