|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventsourcing.AbstractAggregateFactory<T> org.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 type must declare a no-arg constructor accepting.
If the constructor is not accessible (not public), and the JVM's security setting allow it, the GenericAggregateFactory will try to make it accessible. If that doesn't succeed, an exception is thrown.
Constructor Summary | |
---|---|
GenericAggregateFactory(Class<T> aggregateType)
Initialize the AggregateFactory for creating instances of the given aggregateType . |
|
GenericAggregateFactory(Class<T> aggregateType,
ParameterResolverFactory parameterResolverFactory)
Initialize the AggregateFactory for creating instances of the given aggregateType and using the
given parameterResolverFactory to resolve parameters of annotated event handler methods. |
Method Summary | |
---|---|
protected T |
doCreateAggregate(Object aggregateIdentifier,
DomainEventMessage firstEvent)
Create an uninitialized Aggregate instance with the given aggregateIdentifier . |
Class<T> |
getAggregateType()
Returns the type of aggregate this factory creates. |
String |
getTypeIdentifier()
Returns the type identifier for this aggregate factory. |
Methods inherited from class org.axonframework.eventsourcing.AbstractAggregateFactory |
---|
createAggregate, postProcessInstance |
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 GenericAggregateFactory from calling the
constructor.public GenericAggregateFactory(Class<T> aggregateType, ParameterResolverFactory parameterResolverFactory)
aggregateType
and using the
given parameterResolverFactory
to resolve parameters of annotated event handler methods.
Note that the parameterResolverFactory
is only used if the aggregate is an instance of org.axonframework.eventsourcing.annotation.AbstractAnnotatedAggregateRoot
. In other cases, this parameter is
ignored
aggregateType
- The type of aggregate this factory creates instances of.parameterResolverFactory
- THe factory that resolves parameters of annotated event handlers
IncompatibleAggregateException
- if the aggregate constructor throws an exception, or if the JVM security
settings prevent the GenericAggregateFactory from calling the
constructor.Method Detail |
---|
protected 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.
doCreateAggregate
in class AbstractAggregateFactory<T extends EventSourcedAggregateRoot>
aggregateIdentifier
- The identifier of the aggregate to createfirstEvent
- The first event in the Event Stream of the Aggregate
IncompatibleAggregateException
- if the aggregate constructor throws an exception, or if the JVM security
settings prevent the GenericAggregateFactory from calling the
constructor.public String getTypeIdentifier()
AggregateFactory
public Class<T> getAggregateType()
AggregateFactory
instanceOf
this type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |