org.axonframework.eventsourcing.annotation
Class AbstractAnnotatedEntity
java.lang.Object
org.axonframework.eventsourcing.AbstractEventSourcedEntity
org.axonframework.eventsourcing.annotation.AbstractAnnotatedEntity
- All Implemented Interfaces:
- EventSourcedEntity
public abstract class AbstractAnnotatedEntity
- extends AbstractEventSourcedEntity
Convenience super type for entities (other than aggregate roots) that have their event handler methods annotated
with the 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.
- Since:
- 0.7
- Author:
- Allard Buijze
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractAnnotatedEntity
protected AbstractAnnotatedEntity()
- Default constructor.
handle
protected void handle(DomainEventMessage event)
- Calls the appropriate
EventHandler annotated handler with the
provided event.
- Specified by:
handle in class AbstractEventSourcedEntity
- Parameters:
event - The event to handle- See Also:
EventHandler
getChildEntities
protected Collection<EventSourcedEntity> getChildEntities()
- Description copied from class:
AbstractEventSourcedEntity
- Returns a collection of event sourced entities directly referenced by this entity. May return null or an empty
list to indicate no child entities are available. The collection may also contain null values.
- Specified by:
getChildEntities in class AbstractEventSourcedEntity
- Returns:
- a list of event sourced entities contained in this aggregate
Copyright © 2010-2012. All Rights Reserved.