Class RedisStateMachineContextRepository<S,E>
java.lang.Object
org.springframework.statemachine.data.redis.RedisStateMachineContextRepository<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
- All Implemented Interfaces:
StateMachineContextRepository<S,
E, StateMachineContext<S, E>>
public class RedisStateMachineContextRepository<S,E>
extends Object
implements StateMachineContextRepository<S,E,StateMachineContext<S,E>>
A
StateMachineContextRepository
backed by a redis and kryo serialization.- Author:
- Janne Valkealahti
-
Constructor Summary
ConstructorDescriptionRedisStateMachineContextRepository
(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory) Instantiates a new redis state machine context repository. -
Method Summary
Modifier and TypeMethodDescriptiongetContext
(String id) Gets the context.void
save
(StateMachineContext<S, E> context, String id) Save a context.
-
Constructor Details
-
RedisStateMachineContextRepository
public RedisStateMachineContextRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory) Instantiates a new redis state machine context repository.- Parameters:
redisConnectionFactory
- the redis connection factory
-
-
Method Details
-
save
Description copied from interface:StateMachineContextRepository
Save a context.- Specified by:
save
in interfaceStateMachineContextRepository<S,
E, StateMachineContext<S, E>> - Parameters:
context
- the contextid
- the id
-
getContext
Description copied from interface:StateMachineContextRepository
Gets the context.- Specified by:
getContext
in interfaceStateMachineContextRepository<S,
E, StateMachineContext<S, E>> - Parameters:
id
- the id- Returns:
- the context
-