org.axonframework.eventsourcing
Interface EventSourcedEntity

All Known Implementing Classes:
AbstractAnnotatedEntity, AbstractEventSourcedEntity

public interface EventSourcedEntity

Interface towards an Event Sourced Entity that is part of an aggregate, but not its root. Events applied to the aggregate can be propagated to this entity, provided it is properly exposed as a descendant (direct or indirect child) of the aggregate root.

Since:
2.0
Author:
Allard Buijze
See Also:
EventSourcedMember, AbstractEventSourcedAggregateRoot.getChildEntities()

Method Summary
 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.
 

Method Detail

registerAggregateRoot

void registerAggregateRoot(AbstractEventSourcedAggregateRoot aggregateRootToRegister)
Register the aggregate root with this entity. The entity must use this aggregate root to apply Domain Events. The aggregate root is responsible for tracking all applied events.

A parent entity is responsible for invoking this method on its child entities prior to propagating events to it. Typically, this means all entities have their aggregate root set before any actions are taken on it.

Parameters:
aggregateRootToRegister - the root of the aggregate this entity is part of.

handleRecursively

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.

Parameters:
event - The event to handle


Copyright © 2010-2016. All Rights Reserved.