org.axonframework.eventsourcing.annotation
Class AbstractAnnotatedAggregateRoot<I>

java.lang.Object
  extended by org.axonframework.domain.AbstractAggregateRoot<I>
      extended by org.axonframework.eventsourcing.AbstractEventSourcedAggregateRoot<I>
          extended by org.axonframework.eventsourcing.annotation.AbstractAnnotatedAggregateRoot<I>
Type Parameters:
I - The type of the identifier of this aggregate
All Implemented Interfaces:
Serializable, AggregateRoot<I>, EventSourcedAggregateRoot<I>

@MappedSuperclass
public abstract class AbstractAnnotatedAggregateRoot<I>
extends AbstractEventSourcedAggregateRoot<I>

Convenience super type for aggregate roots that have their event handler methods annotated with the EventHandler annotation.

Implementations can call the AbstractEventSourcedAggregateRoot.apply(Object) method to have an event applied.

Since:
0.1
Author:
Allard Buijze
See Also:
EventHandler, Serialized Form

Constructor Summary
AbstractAnnotatedAggregateRoot()
           
 
Method Summary
protected  Collection<EventSourcedEntity> getChildEntities()
          Returns a collection of event sourced entities directly referenced by this entity.
 I getIdentifier()
          Returns the identifier of this aggregate.
protected  void handle(DomainEventMessage event)
          Calls the appropriate EventHandler annotated handler with the provided event.
 
Methods inherited from class org.axonframework.eventsourcing.AbstractEventSourcedAggregateRoot
apply, apply, getVersion, initializeState
 
Methods inherited from class org.axonframework.domain.AbstractAggregateRoot
addEventRegistrationCallback, commitEvents, getLastCommittedEventSequenceNumber, getUncommittedEventCount, getUncommittedEvents, initializeEventStream, isDeleted, markDeleted, registerEvent, registerEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.axonframework.domain.AggregateRoot
addEventRegistrationCallback, commitEvents, getUncommittedEventCount, getUncommittedEvents, isDeleted
 

Constructor Detail

AbstractAnnotatedAggregateRoot

public AbstractAnnotatedAggregateRoot()
Method Detail

handle

protected void handle(DomainEventMessage event)
Calls the appropriate EventHandler annotated handler with the provided event.

Specified by:
handle in class AbstractEventSourcedAggregateRoot<I>
Parameters:
event - The event to handle
See Also:
EventHandler

getIdentifier

public I getIdentifier()
Description copied from interface: AggregateRoot
Returns the identifier of this aggregate.

Returns:
the identifier of this aggregate

getChildEntities

protected Collection<EventSourcedEntity> getChildEntities()
Description copied from class: AbstractEventSourcedAggregateRoot
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.

Events are propagated to the children in the order that the iterator of the return value provides.

Specified by:
getChildEntities in class AbstractEventSourcedAggregateRoot<I>
Returns:
a list of event sourced entities contained in this aggregate


Copyright © 2010-2012. All Rights Reserved.