Class RepositoryStateMachinePersist<M extends RepositoryStateMachine,S,E>

java.lang.Object
org.springframework.statemachine.data.RepositoryStateMachinePersist<M,S,E>
Type Parameters:
S - the type of state
E - the type of event
M - the type of entity
All Implemented Interfaces:
StateMachinePersist<S,E,Object>
Direct Known Subclasses:
JpaRepositoryStateMachinePersist, MongoDbRepositoryStateMachinePersist, RedisRepositoryStateMachinePersist

public abstract class RepositoryStateMachinePersist<M extends RepositoryStateMachine,S,E> extends Object implements StateMachinePersist<S,E,Object>
Base implementation of a StateMachinePersist using Spring Data Repositories.
  • Constructor Details

    • RepositoryStateMachinePersist

      protected RepositoryStateMachinePersist()
      Instantiates a new repository state machine persist using the default KryoStateMachineSerialisationService with no extra registrations.
    • RepositoryStateMachinePersist

      protected RepositoryStateMachinePersist(Consumer<com.esotericsoftware.kryo.Kryo> kryoCustomizer)
      Instantiates a new repository state machine persist using a KryoStateMachineSerialisationService pre-configured with the supplied kryoCustomizer.

      Use this constructor to register application-specific state and event types (typically enums) with Kryo's registration-required allowlist:

      
       new JpaRepositoryStateMachinePersist<>(repo, kryo -> {
           kryo.register(MyStates.class);
           kryo.register(MyEvents.class);
       })
       
      Parameters:
      kryoCustomizer - callback applied to each new Kryo instance; may be null
      Since:
      4.0.2
    • RepositoryStateMachinePersist

      protected RepositoryStateMachinePersist(StateMachineSerialisationService<S,E> serialisationService)
      Instantiates a new repository state machine persist.
      Parameters:
      serialisationService - the serialisation service
  • Method Details