Class SequentialPolicy

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

public class SequentialPolicy extends Object implements SequencingPolicy<Object>
SequencingPolicy that requires sequential handling of all events delivered to an event handler.
Since:
0.3
Author:
Allard Buijze
  • Field Details

    • FULL_SEQUENTIAL_POLICY

      public static final Object FULL_SEQUENTIAL_POLICY
      Object used to represent the full sequential policy.

      Note: This uses a String constant to provide a consistent Object.hashCode() and Object.equals(Object) behaviour across JVM restarts.

  • Constructor Details

    • SequentialPolicy

      public SequentialPolicy()
  • Method Details

    • getSequenceIdentifierFor

      public Object getSequenceIdentifierFor(@Nonnull Object task)
      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<Object>
      Parameters:
      task - the event for which to get the sequencing identifier
      Returns:
      a sequence identifier for the given event