|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.eventsourcing.GenericAggregateFactory<T>
T - The type of aggregate this factory createspublic class GenericAggregateFactory<T extends EventSourcedAggregateRoot>
Aggregate factory that uses a convention to create instances of aggregates. The aggregate must have a constructor with a single parameter: the AggregateIdentifier. This constructor should not do any initialization. The type identifier for the aggregate is the simple name (class name without the package) of the aggregate type.
| Constructor Summary | |
|---|---|
GenericAggregateFactory(Class<T> aggregateType)
Initialize the AggregateFactory for creating instances of the given aggregateType. |
|
| Method Summary | |
|---|---|
T |
createAggregate(AggregateIdentifier aggregateIdentifier,
DomainEvent firstEvent)
Instantiate the aggregate using the given aggregate identifier and first event. |
String |
getTypeIdentifier()
Returns the type identifier for this aggregate factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GenericAggregateFactory(Class<T> aggregateType)
aggregateType.
aggregateType - The type of aggregate this factory creates instances of.
IncompatibleAggregateException - if the aggregate constructor throws an exception, or if the JVM security
settings prevent the GenericEventSourcingRepository from calling the
constructor.| Method Detail |
|---|
public T createAggregate(AggregateIdentifier aggregateIdentifier,
DomainEvent firstEvent)
AggregateSnapshot aware. If the first event is an AggregateSnapshot, the aggregate
is retrieved from the snapshot, instead of creating a new -blank- instance.
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
IncompatibleAggregateException - if the aggregate constructor throws an exception, or if the JVM security
settings prevent the GenericEventSourcingRepository from calling the
constructor.public String getTypeIdentifier()
AggregateFactory
getTypeIdentifier in interface AggregateFactory<T extends EventSourcedAggregateRoot>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||