Package org.apache.shiro.event.support
Class EventListenerComparator
- java.lang.Object
-
- org.apache.shiro.event.support.EventListenerComparator
-
- All Implemented Interfaces:
Comparator<EventListener>
public class EventListenerComparator extends Object implements Comparator<EventListener>
Compares two event listeners to determine the order in which they should be invoked when an event is dispatched. The lower the order, the sooner it will be invoked (the higher its precedence). The higher the order, the later it will be invoked (the lower its precedence). TypedEventListeners have a higher precedence (i.e. a lower order) than standard EventListener instances. Standard EventListener instances have the same order priority. When both objects being compared are TypedEventListeners, they are ordered according to the rules of theEventClassComparator
, using the TypedEventListeners'eventType
.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description EventListenerComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(EventListener a, EventListener b)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
EventListenerComparator
public EventListenerComparator()
-
-
Method Detail
-
compare
public int compare(EventListener a, EventListener b)
- Specified by:
compare
in interfaceComparator<EventListener>
-
-