|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventsourcing.annotation.AggregateAnnotationInspector
public final class AggregateAnnotationInspector
Inspects objects to find aggregate specific annotations, such as AggregateIdentifier
and EventSourcedMember
. The inspector can also create MessageHandlerInvoker
instances to invoke EventSourcingHandler
annotated methods.
EventSourcingHandler
,
EventHandler
Method Summary | ||
---|---|---|
MessageHandlerInvoker |
createEventHandlerInvoker(Object instance)
Creates a new MessageHandlerInvoker that invokes methods on the given instance . |
|
Collection<EventSourcedEntity> |
getChildEntities(Object instance)
Returns the child entities of given instance . |
|
|
getIdentifier(AbstractAnnotatedAggregateRoot<I> aggregateRoot)
Returns the identifier of the given aggregateRoot . |
|
static AggregateAnnotationInspector |
getInspector(Class<?> entityType,
ParameterResolverFactory parameterResolverFactory)
Returns (or creates) an inspector for the given entityType . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static AggregateAnnotationInspector getInspector(Class<?> entityType, ParameterResolverFactory parameterResolverFactory)
entityType
. If an instance is already created for
that type, that instance may be returned. Otherwise, a new inspector is created.
entityType
- The type of entity (aggregate root or simple member) to get an inspector forparameterResolverFactory
- The factory providing access to the parameter resolvers
public MessageHandlerInvoker createEventHandlerInvoker(Object instance)
instance
.
instance
- The object (typically an entity) to create the MessageHandlerInvoker for
instance
public Collection<EventSourcedEntity> getChildEntities(Object instance)
instance
. Entities are detected if they are contained in fields
annotated with EventSourcedMember
. If the annotated field is a collection, map or array, each member of
that collection, the map's key set, the map's value set or the array that implements the EventSourcedEntity
interface is returned.
instance
- The instance to find child entities in
instance
.public <I> I getIdentifier(AbstractAnnotatedAggregateRoot<I> aggregateRoot)
aggregateRoot
. Since only the aggregate root carries the
aggregate's identifier, this method cannot be invoked with any other entity than the aggregate's root.
The field carrying the aggregate identifier must be annotated with AggregateIdentifier
.
I
- The type of identifier declared on the aggregate rootaggregateRoot
- The aggregate root to find the aggregate on
AggregateIdentifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |