HIGHEST_PRECEDENCE is Integer min value ( -2147483648 )
code
Code:
@Aspect
@Order(Ordered.HIGHEST_PRECEDENCE + 5)
public class MyBeforeAdvice
{
@Before("execution(* *(..))")
public void throwEx(JoinPoint jp)
{
throw new IllegalArgumentException("TEST");
}
}
Code:
@Aspect
@Order(Ordered.HIGHEST_PRECEDENCE + 4)
public class MyAfterThrowingAdvice
{
@AfterThrowing(pointcut = "execution(* *(..)) ",throwing = "e")
public void convertExceptions(JoinPoint joinPoint, Throwable e)
{
System.out.println("catching " + e.toString());
}
Code:
<aop:aspectj-autoproxy />
<bean id="beforeBean" class="at.test.MyBeforeAdvice" />
<bean id="afterThrowingBean" class="at.test.MyAfterThrowingAdvice" />