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 Collection<EventSourcedEntity> |
getChildEntities()
Returns a collection of event sourced entities directly referenced by this entity.
|
protected void |
handle(DomainEventMessage event)
Calls the appropriate
EventHandler annotated handler with the
provided event. |
apply, apply, handleRecursively, registerAggregateRootprotected void handle(DomainEventMessage event)
EventHandler annotated handler with the
provided event.handle in class AbstractEventSourcedEntityevent - The event to handleEventHandlerprotected Collection<EventSourcedEntity> getChildEntities()
AbstractEventSourcedEntitygetChildEntities in class AbstractEventSourcedEntityCopyright © 2010-2013. All Rights Reserved.