Class SequentialPerAggregatePolicy

java.lang.Object
org.axonframework.eventhandling.async.SequentialPerAggregatePolicy
All Implemented Interfaces:
SequencingPolicy<EventMessage>

public class SequentialPerAggregatePolicy extends Object implements SequencingPolicy<EventMessage>
Concurrency policy that requires sequential processing of events raised by the same aggregate. Events from different aggregates may be processed in different threads, as will events that do not extend the DomainEvent type.
Since:
0.3
Author:
Allard Buijze
  • Constructor Details

    • SequentialPerAggregatePolicy

      public SequentialPerAggregatePolicy()
  • Method Details

    • instance

      public static SequentialPerAggregatePolicy instance()
      Return a singleton instance of the this Sequencing Policy.
      Returns:
      a singleton SequentialPerAggregatePolicy instance
    • getSequenceIdentifierFor

      public Object getSequenceIdentifierFor(@Nonnull EventMessage event)
      Description copied from interface: SequencingPolicy
      Returns the sequence identifier for the given event. When two events have the same identifier (as defined by their equals method), they will be executed sequentially. A null value indicates that there are no sequencing requirements for the handling of this event.
      Specified by:
      getSequenceIdentifierFor in interface SequencingPolicy<EventMessage>
      Parameters:
      event - the event for which to get the sequencing identifier
      Returns:
      a sequence identifier for the given event