org.springframework.aop.aspectj.autoproxy
Class AspectJPrecedenceComparator
java.lang.Object
org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator
- All Implemented Interfaces:
- Comparator
class AspectJPrecedenceComparator
- extends Object
- implements Comparator
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, Juergen Hoeller
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AspectJPrecedenceComparator
public AspectJPrecedenceComparator()
- Create a default AspectJPrecedenceComparator.
AspectJPrecedenceComparator
public AspectJPrecedenceComparator(Comparator advisorComparator)
- Create a AspectJPrecedenceComparator, using the given Comparator
for comparing
Advisor
instances.
- Parameters:
advisorComparator
- the Comparator to use for Advisors
compare
public int compare(Object o1,
Object o2)
- Specified by:
compare
in interface Comparator
Copyright © 2002-2006 The Spring Framework.