Class SpringAggregateSnapshotter.Builder

java.lang.Object
org.axonframework.eventsourcing.AbstractSnapshotter.Builder
org.axonframework.eventsourcing.AggregateSnapshotter.Builder
org.axonframework.spring.eventsourcing.SpringAggregateSnapshotter.Builder
Enclosing class:
SpringAggregateSnapshotter

public static class SpringAggregateSnapshotter.Builder extends org.axonframework.eventsourcing.AggregateSnapshotter.Builder
Builder class to instantiate a SpringAggregateSnapshotter. The AggregateFactory instances are lazily retrieved by the ApplicationContext.

The Executor is defaulted to an DirectExecutor.INSTANCE, the TransactionManager defaults to a NoTransactionManager and the SpanFactory defaults to a NoOpSpanFactory. Additionally, this Builder has convenience functions to default the ParameterResolverFactory and HandlerDefinition based on instances of these available on the classpath in case these are not provided (respectively AggregateSnapshotter.Builder.buildParameterResolverFactory() and AggregateSnapshotter.Builder.buildHandlerDefinition()). Upon instantiation of a AggregateSnapshotter, it is recommended to use these function to set those fields.

The EventStore is a hard requirement and as such should be provided.

See Also:
  • ClasspathParameterResolverFactory
  • ClasspathHandlerDefinition
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • eventStore

      public SpringAggregateSnapshotter.Builder eventStore(org.axonframework.eventsourcing.eventstore.EventStore eventStore)
      Overrides:
      eventStore in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
    • executor

      public SpringAggregateSnapshotter.Builder executor(Executor executor)
      Overrides:
      executor in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
    • transactionManager

      public SpringAggregateSnapshotter.Builder transactionManager(org.axonframework.common.transaction.TransactionManager transactionManager)
      Overrides:
      transactionManager in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
    • repositoryProvider

      public SpringAggregateSnapshotter.Builder repositoryProvider(org.axonframework.modelling.command.RepositoryProvider repositoryProvider)
      Overrides:
      repositoryProvider in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
    • parameterResolverFactory

      public SpringAggregateSnapshotter.Builder parameterResolverFactory(org.axonframework.messaging.annotation.ParameterResolverFactory parameterResolverFactory)
      Overrides:
      parameterResolverFactory in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
    • handlerDefinition

      public SpringAggregateSnapshotter.Builder handlerDefinition(org.axonframework.messaging.annotation.HandlerDefinition handlerDefinition)
      Overrides:
      handlerDefinition in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
    • spanFactory

      public SpringAggregateSnapshotter.Builder spanFactory(@Nonnull org.axonframework.tracing.SpanFactory spanFactory)
      Overrides:
      spanFactory in class org.axonframework.eventsourcing.AbstractSnapshotter.Builder
    • spanFactory

      public SpringAggregateSnapshotter.Builder spanFactory(@Nonnull org.axonframework.eventsourcing.SnapshotterSpanFactory spanFactory)
      Overrides:
      spanFactory in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
    • build

      Initializes a SpringAggregateSnapshotter as specified through this Builder.
      Overrides:
      build in class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
      Returns:
      a SpringAggregateSnapshotter as specified through this Builder
    • validate

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