public class ThrowsAdviceInterceptor extends ObjectSE implements MethodInterceptor, AfterAdvice
ThrowsAdvice
実装メソッド引数のハンドラーメソッドのシグネチャーは、次の形式である必要があります。
void afterThrowing([Method, args, target], ThrowableSubclass);
最後の引数のみが必要です。
有効なメソッドの例は次のとおりです。
public void afterThrowing(Exception ex)
public void afterThrowing(RemoteException)
public void afterThrowing(Method method, Object[] args, Object target, Exception ex)
public void afterThrowing(Method method, Object[] args, Object target, ServletException ex)
これは、Spring ユーザーが直接使用する必要のないフレームワーククラスです。
MethodBeforeAdviceInterceptor
, AfterReturningAdviceInterceptor
コンストラクターと説明 |
---|
ThrowsAdviceInterceptor(ObjectSE throwsAdvice) 指定された ThrowsAdvice の新しい ThrowsAdviceInterceptor を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
int | getHandlerMethodCount() このアドバイスでハンドラーメソッドの数を返します。 |
ObjectSE | invoke(MethodInvocation mi) このメソッドを実装して、呼び出しの前後に追加の処理を実行します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public ThrowsAdviceInterceptor(ObjectSE throwsAdvice)
throwsAdvice
- 例外ハンドラーメソッドを定義するアドバイスオブジェクト (通常 ThrowsAdvice
実装)public int getHandlerMethodCount()
@Nullable public ObjectSE invoke(MethodInvocation mi) throws ThrowableSE
MethodInterceptor
Joinpoint.proceed()
を呼び出すようにします。MethodInterceptor
の invoke
mi
- メソッド呼び出しジョインポイント Joinpoint.proceed()
の呼び出しの結果。インターセプターによってインターセプトされる可能性があります ThrowableSE
- インターセプターまたはターゲットオブジェクトが例外をスローする場合