AOP切面的优先级Order属性
发布日期:2021-05-10 02:13:32 浏览次数:17 分类:精选文章

本文共 672 字,大约阅读时间需要 2 分钟。

���Spring AOP������������������������������������@Order���������������������������������������������������������������������

���������������������

@Order(2)@Aspect @Component public class MyAspect { @Before("execution(public * calculator.CalculatorImpl.*(..))") public void before(JoinPoint joinPoint) { System.out.println("���������" + Arrays.asList(joinPoint.getArgs())); } }

@Order(3)@Aspect @Component public class MynewAspect { @Before("execution(public * calculator.CalculatorImpl.*(..))") public void before(JoinPoint joinPoint) { System.out.println("���������" + joinPoint.getSignature().getName()); } }

���������������

���������[1, 2] ���������add������add������3

上一篇:AOP重用切入点表达式
下一篇:Spring的AOP五大通知注解

发表评论

最新留言

不错!
[***.144.177.141]2025年04月26日 20时57分10秒