T - a generic specifying the Aggregate type contained in this Repository implementationprotected abstract static class LockingRepository.Builder<T> extends AbstractRepository.Builder<T>
LockingRepository implementations.
The LockFactory is defaulted to a pessimistic locking strategy, implemented in the
PessimisticLockFactory.
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.
aggregateType| Modifier | Constructor and Description |
|---|---|
protected |
Builder(Class<T> aggregateType)
Creates a builder for a Repository for given
aggregateType. |
| Modifier and Type | Method and Description |
|---|---|
LockingRepository.Builder<T> |
aggregateModel(AggregateModel<T> aggregateModel)
Sets the
AggregateModel of generic type T, describing the structure of the aggregate this
Repository will store. |
LockingRepository.Builder<T> |
handlerDefinition(HandlerDefinition handlerDefinition)
Sets the
HandlerDefinition used to create concrete handlers for the given aggregateType. |
LockingRepository.Builder<T> |
lockFactory(LockFactory lockFactory)
Sets the
LockFactory used to lock an aggregate. |
LockingRepository.Builder<T> |
parameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
Sets the
ParameterResolverFactory used to resolve parameters for annotated handlers contained in the
Aggregate. |
buildAggregateModel, validateprotected Builder(Class<T> aggregateType)
aggregateType.aggregateType - the aggregateType specifying the type of aggregate this Repository will
storepublic LockingRepository.Builder<T> parameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
AbstractRepository.BuilderParameterResolverFactory used to resolve parameters for annotated handlers contained in the
Aggregate. Only used if the aggregateType approach is selected to create an AggregateModel.parameterResolverFactory in class AbstractRepository.Builder<T>parameterResolverFactory - a ParameterResolverFactory used to resolve parameters for annotated
handlers contained in the Aggregatepublic LockingRepository.Builder<T> handlerDefinition(HandlerDefinition handlerDefinition)
AbstractRepository.BuilderHandlerDefinition used to create concrete handlers for the given aggregateType.
Only used if the aggregateType approach is selected to create an AggregateModel.handlerDefinition in class AbstractRepository.Builder<T>handlerDefinition - a HandlerDefinition used to create concrete handlers for the given
aggregateType.public LockingRepository.Builder<T> aggregateModel(AggregateModel<T> aggregateModel)
AbstractRepository.BuilderAggregateModel of generic type T, describing the structure of the aggregate this
Repository will store.aggregateModel in class AbstractRepository.Builder<T>aggregateModel - the AggregateModel of generic type T of the aggregate this
Repository will storepublic LockingRepository.Builder<T> lockFactory(LockFactory lockFactory)
LockFactory used to lock an aggregate. Defaults to a pessimistic locking strategy,
implemented in the PessimisticLockFactory.lockFactory - a LockFactory used to lock an aggregateCopyright © 2010–2019. All rights reserved.