-- 基于表达式方式
AspectJExpressionPointcut cut = new AspectJExpressionPointcut();
cut.setExpression("* com.xx.service..*.*(..))");
Advisor advisor = new DefaultPointcutAdvisor(cut,实现MethodInterceptor接口);
-- 注解形式
DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(new AnnotationMatchingPointcut(null, XX.class),
,实现MethodInterceptor接口);
advisor.setOrder(0);
spring configuration 配置 aop
最新推荐文章于 2025-04-14 10:18:19 发布