Class LockingRepository.Builder<T>
- Type Parameters:
T- a generic specifying the Aggregate type contained in thisRepositoryimplementation
- Direct Known Subclasses:
EventSourcingRepository.Builder,GenericJpaRepository.Builder,GenericJpaRepository.Builder
- Enclosing class:
LockingRepository<T,A extends Aggregate<T>>
LockingRepository implementations.
The LockFactory is defaulted to a pessimistic locking strategy, implemented in the
PessimisticLockFactory. The SpanFactory is defaulted to a
NoOpSpanFactory. A goal of this Builder goal is to create an
AggregateModel specifying generic T as the aggregate type to be stored. All aggregates in this
repository must be instanceOf this aggregate type. To instantiate this AggregateModel, either an
AggregateModel can be provided directly or an aggregateType of type Class can be used.
The latter will internally resolve to an AggregateModel. Thus, either the AggregateModel or the
aggregateType should be provided.
-
Field Summary
Fields inherited from class org.axonframework.modelling.command.AbstractRepository.Builder
aggregateType, subtypes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregateModel(AggregateModel<T> aggregateModel) Sets theAggregateModelof generic typeT, describing the structure of the aggregate thisRepositorywill store.handlerDefinition(HandlerDefinition handlerDefinition) Sets theHandlerDefinitionused to create concrete handlers for the givenaggregateType.lockFactory(LockFactory lockFactory) Sets theLockFactoryused to lock an aggregate.parameterResolverFactory(ParameterResolverFactory parameterResolverFactory) Sets theParameterResolverFactoryused to resolve parameters for annotated handlers contained in the Aggregate.spanFactory(SpanFactory spanFactory) Deprecated.Sets a subtype of theaggregate typerepresented by thisRepository.Sets the subtypes of theaggregate typerepresented by thisRepository.Methods inherited from class org.axonframework.modelling.command.AbstractRepository.Builder
buildAggregateModel, spanFactory, validate
-
Constructor Details
-
Builder
Creates a builder for a Repository for givenaggregateType.- Parameters:
aggregateType- theaggregateTypespecifying the type of aggregate thisRepositorywill store
-
-
Method Details
-
parameterResolverFactory
public LockingRepository.Builder<T> parameterResolverFactory(@Nonnull ParameterResolverFactory parameterResolverFactory) Description copied from class:AbstractRepository.BuilderSets theParameterResolverFactoryused to resolve parameters for annotated handlers contained in the Aggregate. Only used if theaggregateTypeapproach is selected to create anAggregateModel.- Overrides:
parameterResolverFactoryin classAbstractRepository.Builder<T>- Parameters:
parameterResolverFactory- aParameterResolverFactoryused to resolve parameters for annotated handlers contained in the Aggregate- Returns:
- the current Builder instance, for fluent interfacing
-
handlerDefinition
Description copied from class:AbstractRepository.BuilderSets theHandlerDefinitionused to create concrete handlers for the givenaggregateType. Only used if theaggregateTypeapproach is selected to create anAggregateModel.- Overrides:
handlerDefinitionin classAbstractRepository.Builder<T>- Parameters:
handlerDefinition- aHandlerDefinitionused to create concrete handlers for the givenaggregateType.- Returns:
- the current Builder instance, for fluent interfacing
-
aggregateModel
Description copied from class:AbstractRepository.BuilderSets theAggregateModelof generic typeT, describing the structure of the aggregate thisRepositorywill store.- Overrides:
aggregateModelin classAbstractRepository.Builder<T>- Parameters:
aggregateModel- theAggregateModelof generic typeTof the aggregate thisRepositorywill store- Returns:
- the current Builder instance, for fluent interfacing
-
subtypes
Description copied from class:AbstractRepository.BuilderSets the subtypes of theaggregate typerepresented by thisRepository. Defining subtypes indicates thisRepositorysupports polymorphic aggregate structure.Only used if the
aggregate modelis not explicitly set. Defaults to an emptySet.- Overrides:
subtypesin classAbstractRepository.Builder<T>- Parameters:
subtypes- The subtypes of theaggregate typerepresented by thisRepository.- Returns:
- The current Builder instance, for fluent interfacing.
-
subtype
Description copied from class:AbstractRepository.BuilderSets a subtype of theaggregate typerepresented by thisRepository. Defining a subtype indicates thisRepositorysupports a polymorphic aggregate structure.Only used if the
aggregate modelis not explicitly set.- Overrides:
subtypein classAbstractRepository.Builder<T>- Parameters:
subtype- A subtypes of theaggregate typerepresented by thisRepository.- Returns:
- The current Builder instance, for fluent interfacing.
-
spanFactory
Deprecated.Description copied from class:AbstractRepository.BuilderSets theSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aNoOpSpanFactoryby default, which provides no tracing capabilities.- Overrides:
spanFactoryin classAbstractRepository.Builder<T>- Parameters:
spanFactory- TheSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
lockFactory
Sets theLockFactoryused to lock an aggregate. Defaults to a pessimistic locking strategy, implemented in thePessimisticLockFactory.- Parameters:
lockFactory- aLockFactoryused to lock an aggregate- Returns:
- the current Builder instance, for fluent interfacing
-