|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.eventsourcing.AbstractEventSourcedEntity
public abstract class AbstractEventSourcedEntity
Base class for Event Sourced entities that are not at the root of the aggregate. Instead of keeping track of uncommitted events themselves, these entities refer to their aggregate root to do that for them. A DomainEvent published in any of the entities in an Aggregate is published to all entities in the entire aggregate.
| Constructor Summary | |
|---|---|
AbstractEventSourcedEntity()
|
|
| Method Summary | |
|---|---|
protected void |
apply(DomainEvent event)
Apply the provided event. |
protected Collection<AbstractEventSourcedEntity> |
getChildEntities()
Returns a list of event sourced entities directly referenced by this entity. |
protected abstract void |
handle(DomainEvent event)
Apply state changes based on the given event. |
protected void |
registerAggregateRoot(AbstractEventSourcedAggregateRoot aggregateRootToRegister)
Register the aggregate root with this entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractEventSourcedEntity()
| Method Detail |
|---|
protected Collection<AbstractEventSourcedEntity> getChildEntities()
AbstractEventSourcedEntity
implementations.
It will look for them in the following locations: Iterable;Map
protected void registerAggregateRoot(AbstractEventSourcedAggregateRoot aggregateRootToRegister)
aggregateRootToRegister - the root of the aggregate this entity is part of.protected abstract void handle(DomainEvent event)
event - The event to handleprotected void apply(DomainEvent event)
handle(DomainEvent) event handler method} for processing.
Note that all entities part of the aggregate that this entity is part of are notified of the event.
event - The event to apply
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||