Java Spring AOP切入点表达式以排除注释

Java Spring AOP切入点表达式以排除注释,java,spring,aop,Java,Spring,Aop,我试图创建一个切入点表达式,该表达式将在特定包中的所有方法上启动,但不会基于自定义注释启动。这是我到目前为止对第一次执行有效但对第二次执行无效的内容。谢谢你的帮助 @AfterThrowing(pointcut = "execution(* services..*.*(..)) && !within(@services.annotation.IgnoreBusinessServiceExceptionTranslation *)", throwing = "ex") publ

我试图创建一个切入点表达式,该表达式将在特定包中的所有方法上启动,但不会基于自定义注释启动。这是我到目前为止对第一次执行有效但对第二次执行无效的内容。谢谢你的帮助

@AfterThrowing(pointcut = "execution(* services..*.*(..)) && !within(@services.annotation.IgnoreBusinessServiceExceptionTranslation *)", throwing = "ex") 

public void exceptionThrown( Throwable ex ){}
接口:

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface IgnoreBusinessServiceExceptionTranslation
{}

为其他人找到了答案

@AfterThrowing(pointcut = "execution(* services..*.*(..)) && !@annotation(services.annotation.IgnoreBusinessServiceExceptionTranslation)", throwing = "ex") 

public void exceptionThrown( Throwable ex ){}