This PR provides the ability to use @Order
sorting for Advice Annotation.
Example:
@Aspect
public class MyAspect {
@Order(1)
@Before("execution(* org.example.AopObj.*(..))")
public void method1() {
System.out.println("Before method-1");
}
@Order(2)
@Before("execution(* org.example.AopObj.*(..))")
public void method2() {
System.out.println("Before method-2");
}
}
method1()
will be executed before method2()
because the sequence number of method1()
is smaller.
Comment From: snicoll
Thanks for the PR. This was declined in #29732 and #32570 already.