@Bean public Advisor errorHandlingAdvisor() { AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut(); pointcut.setExpression("org.sculptor.examples.boot.config.AopConfig.service()"); DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(pointcut, errorHandlingAdvice()); advisor.setOrder(3); return advisor; }
@Bean public Advisor jpaFlushEagerAdvisor() { AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut(); pointcut.setExpression( "org.sculptor.examples.boot.config.AopConfig.service() && !org.sculptor.examples.boot.config.AopConfig.readOnlyMethod()"); DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(pointcut, jpaFlushEagerAdvice()); advisor.setOrder(4); return advisor; }