|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.axonframework.eventsourcing.AbstractAggregateFactory<T>
T
- The type of Aggregate created by this factorypublic abstract class AbstractAggregateFactory<T extends EventSourcedAggregateRoot>
Abstract AggregateFactory implementation that is aware of snapshot events. If an incoming event is not a snapshot event, creation is delegated to the subclass.
Constructor Summary | |
---|---|
protected |
AbstractAggregateFactory()
|
protected |
AbstractAggregateFactory(ParameterResolverFactory parameterResolverFactory)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.axonframework.eventsourcing.AggregateFactory |
---|
getAggregateType, getTypeIdentifier |
Constructor Detail |
---|
protected AbstractAggregateFactory()
protected AbstractAggregateFactory(ParameterResolverFactory parameterResolverFactory)
Method Detail |
---|
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 event
protected T postProcessInstance(T aggregate)
This method can be safely overridden. This implementation does nothing.
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 Aggregate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |