T
- The type of Aggregate created by this factorypublic abstract class AbstractAggregateFactory<T extends EventSourcedAggregateRoot> extends Object implements AggregateFactory<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractAggregateFactory() |
protected |
AbstractAggregateFactory(ParameterResolverFactory parameterResolverFactory) |
Modifier and Type | Method and Description |
---|---|
T |
createAggregate(Object aggregateIdentifier,
DomainEventMessage<?> firstEvent)
Instantiate the aggregate using the given aggregate identifier and first event.
|
protected abstract T |
doCreateAggregate(Object aggregateIdentifier,
DomainEventMessage firstEvent)
Create an uninitialized Aggregate instance with the given
aggregateIdentifier . |
protected T |
postProcessInstance(T aggregate)
Perform any processing that must be done on an aggregate instance that was reconstructed from a Snapshot
Event.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAggregateType, getTypeIdentifier
protected AbstractAggregateFactory()
protected AbstractAggregateFactory(ParameterResolverFactory parameterResolverFactory)
public final T createAggregate(Object aggregateIdentifier, DomainEventMessage<?> firstEvent)
AggregateFactory
createAggregate
in interface AggregateFactory<T extends EventSourcedAggregateRoot>
aggregateIdentifier
- the aggregate identifier of the aggregate to instantiatefirstEvent
- The first event in the event stream. This is either the event generated during
creation of the aggregate, or a snapshot eventprotected T postProcessInstance(T aggregate)
aggregate
- The aggregate to post-process.protected abstract T doCreateAggregate(Object aggregateIdentifier, DomainEventMessage firstEvent)
aggregateIdentifier
. The given
firstEvent
can be used to define the requirements of the aggregate to create.
The given firstEvent
is never a snapshot event.aggregateIdentifier
- The identifier of the aggregate to createfirstEvent
- The first event in the Event Stream of the AggregateCopyright © 2010-2014. All Rights Reserved.