public abstract class AbstractAnnotatedEntity extends AbstractEventSourcedEntity
EventHandler
annotation.
Note that each entity receives all events applied in the entire aggregate. Entities are responsible
for filtering out the actual events to take action on.
If this entity is a child of another AbstractAnnotatedEntity
or
AbstractAnnotatedAggregateRoot
, the field that this entity is stored in should be annotated with EventSourcedMember
. Alternatively, the AbstractEventSourcedEntity.getChildEntities()
or AbstractEventSourcedAggregateRoot.getChildEntities()
should return a collection
containing this entity instance.Modifier | Constructor and Description |
---|---|
protected |
AbstractAnnotatedEntity()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected ParameterResolverFactory |
createParameterResolverFactory()
Creates (or returns) a ParameterResolverFactory which is used by this aggregate root to resolve the parameters
for @EventSourcingHandler annotated methods.
|
protected Collection<EventSourcedEntity> |
getChildEntities()
Returns a collection of event sourced entities directly referenced by this entity.
|
protected void |
handle(DomainEventMessage event)
Calls the appropriate handler method with the provided event.
|
apply, apply, getAggregateRoot, handleRecursively, registerAggregateRoot
protected void handle(DomainEventMessage event)
handle
in class AbstractEventSourcedEntity
event
- The event to handleEventSourcingHandler
,
EventHandler
protected Collection<EventSourcedEntity> getChildEntities()
AbstractEventSourcedEntity
getChildEntities
in class AbstractEventSourcedEntity
protected ParameterResolverFactory createParameterResolverFactory()
Copyright © 2010-2014. All Rights Reserved.