org.springframework.aop.aspectj.autoproxy
Class AspectJPrecedenceAwareOrderComparator
java.lang.Object
org.springframework.core.OrderComparator
org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceAwareOrderComparator
- All Implemented Interfaces:
- Comparator
class AspectJPrecedenceAwareOrderComparator
- extends OrderComparator
Orders AspectJ advice/advisors by precedence (not invocation order).
Given two pieces of advice, a
and b
:
- if
a
and b
are defined in different
aspects, then the advice in the aspect with the lowest order
value has the highest precedence
- if
a
and b
are defined in the same
aspect, then if one of a
or b
is a form of
after advice, then the advice declared last in the aspect has the
highest precedence. If neither a
nor b
is a
form of after advice, then the advice declared first in the aspect has
the highest precedence.
Important :- note that unlike a normal comparator a return of 0 means
we don't care about the ordering, not that the two elements must be sorted
identically. Used with AspectJ PartialOrder class.
- Since:
- 2.0
- Author:
- Adrian Colyer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AspectJPrecedenceAwareOrderComparator
AspectJPrecedenceAwareOrderComparator()
compare
public int compare(Object o1,
Object o2)
- Specified by:
compare
in interface Comparator
- Overrides:
compare
in class OrderComparator
Copyright © 2002-2006 The Spring Framework.