public static class SpringAggregateSnapshotter.Builder extends AggregateSnapshotter.Builder
SpringAggregateSnapshotter. The AggregateFactory
instances are lazily retrieved by the ApplicationContext.
The Executor is defaulted to an DirectExecutor.INSTANCE and the
TransactionManager defaults to a NoTransactionManager.
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.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
SpringAggregateSnapshotter |
build()
Initializes a
SpringAggregateSnapshotter as specified through this Builder. |
SpringAggregateSnapshotter.Builder |
eventStore(EventStore eventStore)
Sets the
EventStore instance which this AbstractSnapshotter implementation will store
snapshots in. |
SpringAggregateSnapshotter.Builder |
executor(Executor executor)
Sets the
Executor which handles the actual snapshot creation process. |
SpringAggregateSnapshotter.Builder |
handlerDefinition(HandlerDefinition handlerDefinition)
Sets the
HandlerDefinition used to create concrete handlers in the snapshot aggregate this
snapshotter creates. |
SpringAggregateSnapshotter.Builder |
parameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
Sets the
ParameterResolverFactory used to resolve parameter values for annotated handlers in the
snapshot aggregate this snapshotter creates. |
SpringAggregateSnapshotter.Builder |
repositoryProvider(RepositoryProvider repositoryProvider)
Sets the
RepositoryProvider provided to the snapshot aggregates this snapshotter creates for correct
instantiation. |
SpringAggregateSnapshotter.Builder |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to manage the transaction around storing the snapshot. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
aggregateFactories, aggregateFactories, buildHandlerDefinition, buildParameterResolverFactorypublic SpringAggregateSnapshotter.Builder eventStore(EventStore eventStore)
AbstractSnapshotter.BuilderEventStore instance which this AbstractSnapshotter implementation will store
snapshots in.eventStore in class AggregateSnapshotter.BuildereventStore - the EventStore instance which this AbstractSnapshotter implementation will
store snapshots inpublic SpringAggregateSnapshotter.Builder executor(Executor executor)
AbstractSnapshotter.BuilderExecutor which handles the actual snapshot creation process. Defaults to a
DirectExecutor.executor in class AggregateSnapshotter.Builderexecutor - an Executor which handles the actual snapshot creation processpublic SpringAggregateSnapshotter.Builder transactionManager(TransactionManager transactionManager)
AbstractSnapshotter.BuilderTransactionManager used to manage the transaction around storing the snapshot. Defaults to a
NoTransactionManager.transactionManager in class AggregateSnapshotter.BuildertransactionManager - the TransactionManager used to manage the transaction around storing the
snapshotpublic SpringAggregateSnapshotter.Builder repositoryProvider(RepositoryProvider repositoryProvider)
AggregateSnapshotter.BuilderRepositoryProvider provided to the snapshot aggregates this snapshotter creates for correct
instantiation.repositoryProvider in class AggregateSnapshotter.BuilderrepositoryProvider - the RepositoryProvider provided to the snapshot aggregates this snapshotter
creates for correct instantiationpublic SpringAggregateSnapshotter.Builder parameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
AggregateSnapshotter.BuilderParameterResolverFactory used to resolve parameter values for annotated handlers in the
snapshot aggregate this snapshotter creates.parameterResolverFactory in class AggregateSnapshotter.BuilderparameterResolverFactory - the ParameterResolverFactory used to resolve parameter values for
annotated handlers in the snapshot aggregate this snapshotter createspublic SpringAggregateSnapshotter.Builder handlerDefinition(HandlerDefinition handlerDefinition)
AggregateSnapshotter.BuilderHandlerDefinition used to create concrete handlers in the snapshot aggregate this
snapshotter creates.handlerDefinition in class AggregateSnapshotter.BuilderhandlerDefinition - the HandlerDefinition used to create concrete handlers in the snapshot
aggregate this snapshotter createspublic SpringAggregateSnapshotter build()
SpringAggregateSnapshotter as specified through this Builder.build in class AggregateSnapshotter.BuilderSpringAggregateSnapshotter as specified through this Builderprotected void validate()
throws AxonConfigurationException
validate in class AggregateSnapshotter.BuilderAxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2018. All rights reserved.