public abstract class AbstractEventSourcedEntity extends Object implements EventSourcedEntity
Constructor and Description |
---|
AbstractEventSourcedEntity() |
Modifier and Type | Method and Description |
---|---|
protected void |
apply(Object event)
Apply the provided event.
|
protected void |
apply(Object event,
MetaData metaData)
Apply the provided event and attaching the given
metaData . |
protected AbstractEventSourcedAggregateRoot |
getAggregateRoot()
Returns the reference to the root of the aggregate this entity is a member of.
|
protected abstract Collection<? extends EventSourcedEntity> |
getChildEntities()
Returns a collection of event sourced entities directly referenced by this entity.
|
protected abstract void |
handle(DomainEventMessage event)
Apply state changes based on the given event.
|
void |
handleRecursively(DomainEventMessage event)
Report the given
event for handling in the current instance (this ), as well as all the
entities referenced by this instance. |
void |
registerAggregateRoot(AbstractEventSourcedAggregateRoot aggregateRootToRegister)
Register the aggregate root with this entity.
|
public void registerAggregateRoot(AbstractEventSourcedAggregateRoot aggregateRootToRegister)
EventSourcedEntity
registerAggregateRoot
in interface EventSourcedEntity
aggregateRootToRegister
- the root of the aggregate this entity is part of.public void handleRecursively(DomainEventMessage event)
EventSourcedEntity
event
for handling in the current instance (this
), as well as all the
entities referenced by this instance.handleRecursively
in interface EventSourcedEntity
event
- The event to handleprotected abstract Collection<? extends EventSourcedEntity> getChildEntities()
protected abstract void handle(DomainEventMessage event)
event
- The event to handleprotected void apply(Object event)
handle(org.axonframework.domain.DomainEventMessage)
event handler method} for processing.
The event is applied on all entities part of this aggregate.event
- The payload of the event to applyprotected void apply(Object event, MetaData metaData)
metaData
. Applying events means they are added to
the uncommitted event queue and forwarded to the handle(org.axonframework.domain.DomainEventMessage)
event handler method} for processing.
The event is applied on all entities part of this aggregate.event
- The payload of the event to applymetaData
- any meta-data that must be registered with the Eventprotected AbstractEventSourcedAggregateRoot getAggregateRoot()
Copyright © 2010-2014. All Rights Reserved.