T
- The type of aggregate this factory createspublic class GenericAggregateFactory<T extends EventSourcedAggregateRoot> extends AbstractAggregateFactory<T>
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
createAggregate, postProcessInstance
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
ignoredaggregateType
- The type of aggregate this factory creates instances of.parameterResolverFactory
- THe factory that resolves parameters of annotated event handlersIncompatibleAggregateException
- if the aggregate constructor throws an exception, or if the JVM security
settings prevent the GenericAggregateFactory from calling the
constructor.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 AggregateIncompatibleAggregateException
- 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.Copyright © 2010-2014. All Rights Reserved.