2016-05-12 55 views
1

特定のパッケージ内のすべてのメソッドで発生しますが、カスタム注釈に基づいて起動するポイントカット式を作成しようとしています。ここでは、最初の実行では動作しますが、2番目では動作しません。助けてくれてありがとう!注釈を除外するSpring AOPポイントカット式

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

public void exceptionThrown(Throwable ex){} 

インタフェース:

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

答えて

3

は誰のための答えを見つけました!

@AfterThrowing(pointcut = "execution(* services..*.*(..)) && [email protected](services.annotation.IgnoreBusinessServiceExceptionTranslation)", throwing = "ex") 

public void exceptionThrown(Throwable ex){} 
関連する問題