org.axonframework.quickstart.handler
Class ToDoItem

java.lang.Object
  extended by org.axonframework.domain.AbstractAggregateRoot<I>
      extended by org.axonframework.eventsourcing.AbstractEventSourcedAggregateRoot
          extended by org.axonframework.quickstart.handler.ToDoItem
All Implemented Interfaces:
Serializable, AggregateRoot, EventSourcedAggregateRoot

public class ToDoItem
extends AbstractEventSourcedAggregateRoot

Author:
Jettro Coenradie
See Also:
Serialized Form

Constructor Summary
ToDoItem()
           
ToDoItem(String id, String description)
           
 
Method Summary
protected  Iterable<? extends EventSourcedEntity> getChildEntities()
          Returns a collection of event sourced entities directly referenced by this entity.
 Object getIdentifier()
          Returns the identifier of this aggregate.
protected  void handle(DomainEventMessage eventMessage)
          Apply state changes based on the given event.
 void markCompleted()
           
 
Methods inherited from class org.axonframework.eventsourcing.AbstractEventSourcedAggregateRoot
apply, apply, commitEvents, getVersion, initializeState, isLive
 
Methods inherited from class org.axonframework.domain.AbstractAggregateRoot
addEventRegistrationCallback, getLastCommittedEventSequenceNumber, getUncommittedEventCount, getUncommittedEvents, initializeEventStream, isDeleted, markDeleted, registerEvent, registerEvent, registerEventMessage
 
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, getUncommittedEventCount, getUncommittedEvents, isDeleted
 

Constructor Detail

ToDoItem

public ToDoItem()

ToDoItem

public ToDoItem(String id,
                String description)
Method Detail

markCompleted

public void markCompleted()

getChildEntities

protected Iterable<? extends 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
Returns:
a list of event sourced entities contained in this aggregate

handle

protected void handle(DomainEventMessage eventMessage)
Description copied from class: AbstractEventSourcedAggregateRoot
Apply state changes based on the given event.

Note: Implementations of this method should *not* perform validation.

Specified by:
handle in class AbstractEventSourcedAggregateRoot
Parameters:
eventMessage - The event to handle

getIdentifier

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

Returns:
the identifier of this aggregate


Copyright © 2010-2016. All Rights Reserved.