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:
-
ClasspathParameterResolverFactoryClasspathHandlerDefinition
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aSpringAggregateSnapshotteras specified through this Builder.eventStore(org.axonframework.eventsourcing.eventstore.EventStore eventStore) handlerDefinition(org.axonframework.messaging.annotation.HandlerDefinition handlerDefinition) parameterResolverFactory(org.axonframework.messaging.annotation.ParameterResolverFactory parameterResolverFactory) repositoryProvider(org.axonframework.modelling.command.RepositoryProvider repositoryProvider) spanFactory(org.axonframework.eventsourcing.SnapshotterSpanFactory spanFactory) spanFactory(org.axonframework.tracing.SpanFactory spanFactory) transactionManager(org.axonframework.common.transaction.TransactionManager transactionManager) protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.Methods inherited from class org.axonframework.eventsourcing.AggregateSnapshotter.Builder
aggregateFactories, aggregateFactories, buildHandlerDefinition, buildParameterResolverFactory
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
eventStore
public SpringAggregateSnapshotter.Builder eventStore(org.axonframework.eventsourcing.eventstore.EventStore eventStore) - Overrides:
eventStorein classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder
-
executor
- Overrides:
executorin classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder
-
transactionManager
public SpringAggregateSnapshotter.Builder transactionManager(org.axonframework.common.transaction.TransactionManager transactionManager) - Overrides:
transactionManagerin classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder
-
repositoryProvider
public SpringAggregateSnapshotter.Builder repositoryProvider(org.axonframework.modelling.command.RepositoryProvider repositoryProvider) - Overrides:
repositoryProviderin classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder
-
parameterResolverFactory
public SpringAggregateSnapshotter.Builder parameterResolverFactory(org.axonframework.messaging.annotation.ParameterResolverFactory parameterResolverFactory) - Overrides:
parameterResolverFactoryin classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder
-
handlerDefinition
public SpringAggregateSnapshotter.Builder handlerDefinition(org.axonframework.messaging.annotation.HandlerDefinition handlerDefinition) - Overrides:
handlerDefinitionin classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder
-
spanFactory
public SpringAggregateSnapshotter.Builder spanFactory(@Nonnull org.axonframework.tracing.SpanFactory spanFactory) - Overrides:
spanFactoryin classorg.axonframework.eventsourcing.AbstractSnapshotter.Builder
-
spanFactory
public SpringAggregateSnapshotter.Builder spanFactory(@Nonnull org.axonframework.eventsourcing.SnapshotterSpanFactory spanFactory) - Overrides:
spanFactoryin classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder
-
build
Initializes aSpringAggregateSnapshotteras specified through this Builder.- Overrides:
buildin classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder- Returns:
- a
SpringAggregateSnapshotteras specified through this Builder
-
validate
protected void validate() throws org.axonframework.common.AxonConfigurationExceptionValidates whether the fields contained in this Builder are set accordingly.- Overrides:
validatein classorg.axonframework.eventsourcing.AggregateSnapshotter.Builder- Throws:
org.axonframework.common.AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-