org.axonframework.eventsourcing.annotation
Class AbstractAnnotatedAggregateRoot

java.lang.Object
  extended by org.axonframework.domain.AbstractAggregateRoot
      extended by org.axonframework.eventsourcing.AbstractEventSourcedAggregateRoot
          extended by org.axonframework.eventsourcing.annotation.AbstractAnnotatedAggregateRoot
All Implemented Interfaces:
Serializable, AggregateRoot, EventSourcedAggregateRoot

public abstract class AbstractAnnotatedAggregateRoot
extends AbstractEventSourcedAggregateRoot

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

Implementations can call the AbstractEventSourcedAggregateRoot.apply(DomainEvent) method to have an event applied. S *

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

Constructor Summary
protected AbstractAnnotatedAggregateRoot()
          Initialize the aggregate root with a random identifier.
protected AbstractAnnotatedAggregateRoot(AggregateIdentifier identifier)
          Initializes the aggregate root using the provided aggregate identifier.
protected AbstractAnnotatedAggregateRoot(UUID identifier)
          Deprecated. Use #AbstractEventSourcedAggregateRoot(org.axonframework.domain.AggregateIdentifier)
 
Method Summary
protected  void handle(DomainEvent event)
          Calls the appropriate EventHandler annotated handler with the provided event.
 
Methods inherited from class org.axonframework.eventsourcing.AbstractEventSourcedAggregateRoot
apply, getChildEntities, initializeState
 
Methods inherited from class org.axonframework.domain.AbstractAggregateRoot
commitEvents, getIdentifier, getUncommittedEventCount, getUncommittedEvents, getVersion, initializeEventStream, 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
commitEvents, getIdentifier, getUncommittedEventCount, getUncommittedEvents, getVersion
 

Constructor Detail

AbstractAnnotatedAggregateRoot

protected AbstractAnnotatedAggregateRoot()
Initialize the aggregate root with a random identifier.


AbstractAnnotatedAggregateRoot

protected AbstractAnnotatedAggregateRoot(AggregateIdentifier identifier)
Initializes the aggregate root using the provided aggregate identifier.

Parameters:
identifier - the identifier of this aggregate

AbstractAnnotatedAggregateRoot

@Deprecated
protected AbstractAnnotatedAggregateRoot(UUID identifier)
Deprecated. Use #AbstractEventSourcedAggregateRoot(org.axonframework.domain.AggregateIdentifier)

Initializes the aggregate root using the provided aggregate identifier.

Parameters:
identifier - the identifier of this aggregate
Method Detail

handle

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

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


Copyright © 2011. All Rights Reserved.