Class HandlerComparator

java.lang.Object
org.axonframework.messaging.core.annotation.HandlerComparator

public final class HandlerComparator extends Object
Comparator used by AnnotatedHandlerInspector to sort MessageHandlingMember entity members.

The ordering among MessageHandlingMembers through this comparator is defined as follows:

  1. The MessageHandlingMember.priority(), favoring the largest number
  2. The class hierarchy of the MessageHandlingMember.payloadType(), favoring the most specific handler.
  3. The parameter count on the actual message handling function, favoring the highest number as the most specific handler.
  4. As a final tiebreaker, the Executable.toGenericString() of the actual message handling function
If the given MessageHandlingMembers both act on results rather, steps 2 through 4 are reversed.
Since:
3.0.0
Author:
Allard Buijze
  • Method Details

    • instance

      public static Comparator<MessageHandlingMember<?>> instance()
      Returns the singleton comparator managed by the HandlerComparator class.
      Returns:
      the singleton comparator