Class JpaSagaStore.Builder

java.lang.Object
org.axonframework.modelling.saga.repository.jpa.JpaSagaStore.Builder
Enclosing class:
JpaSagaStore

public static class JpaSagaStore.Builder extends Object
Builder class to instantiate a JpaSagaStore.

The EntityManagerProvider and Serializer are hard requirements and as such should be provided.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • entityManagerProvider

      public JpaSagaStore.Builder entityManagerProvider(EntityManagerProvider entityManagerProvider)
      Sets the EntityManagerProvider which provides the EntityManager used to access the underlying database.
      Parameters:
      entityManagerProvider - a EntityManagerProvider which provides the EntityManager used to access the underlying database
      Returns:
      the current Builder instance, for fluent interfacing
    • serializer

      public JpaSagaStore.Builder serializer(Serializer serializer)
      Sets the Serializer used to de-/serialize a Saga instance.
      Parameters:
      serializer - a Serializer used to de-/serialize a Saga instance
      Returns:
      the current Builder instance, for fluent interfacing
    • build

      public JpaSagaStore build()
      Initializes a JpaSagaStore as specified through this Builder.
      Returns:
      a JpaSagaStore as specified through this Builder
    • validate

      protected void validate() throws AxonConfigurationException
      Validates whether the fields contained in this Builder are set accordingly.
      Throws:
      AxonConfigurationException - if one field is asserted to be incorrect according to the Builder's specifications