クラス DelegatePerTargetObjectIntroductionInterceptor
java.lang.ObjectSE
org.springframework.aop.support.IntroductionInfoSupport
org.springframework.aop.support.DelegatePerTargetObjectIntroductionInterceptor
- 実装されたすべてのインターフェース:
SerializableSE
、Advice
、Interceptor
、MethodInterceptor
、DynamicIntroductionAdvice
、IntroductionInfo
、IntroductionInterceptor
public class DelegatePerTargetObjectIntroductionInterceptor
extends IntroductionInfoSupport
implements IntroductionInterceptor
IntroductionInterceptor
インターフェースの便利な実装。 これは DelegatingIntroductionInterceptor
とは異なり、このクラスの単一インスタンスを使用して複数のターゲットオブジェクトにアドバイスを提供でき、各ターゲットオブジェクトには独自のデリゲートがあります(DelegatingIntroductionInterceptor は同じデリゲートを共有するため、すべてのターゲットで同じ状態になります)。
suppressInterface
メソッドは、デリゲートクラスによって実装されたインターフェースを抑制するために使用できますが、所有している AOP プロキシに導入すべきではありません。
デリゲートが直列化できる場合、このクラスのインスタンスは直列化可能です。
メモ: このクラスと DelegatingIntroductionInterceptor
の間にはいくつかの実装上の類似点があり、将来的に共通の祖先クラスを抽出するためのリファクタリングの可能性を提案しています。
- 導入:
- 2.0
- 作成者:
- Adrian Colyer, Juergen Hoeller
- 関連事項:
フィールドサマリー
クラス org.springframework.aop.support.IntroductionInfoSupport から継承されたフィールド
publishedInterfaces
コンストラクターのサマリー
コンストラクター説明DelegatePerTargetObjectIntroductionInterceptor
(ClassSE<?> defaultImplType, ClassSE<?> interfaceType) 方法の概要
修飾子と型メソッド説明protected ObjectSE
提供されたMethodInterceptor
に進みます。サブクラスは、アラウンドアドバイスでカスタム動作を実行する場合、これをオーバーライドする必要があります。クラス org.springframework.aop.support.IntroductionInfoSupport から継承されたメソッド
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterface
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.aop.DynamicIntroductionAdvice から継承されたメソッド
implementsInterface
コンストラクターの詳細
DelegatePerTargetObjectIntroductionInterceptor
メソッドの詳細
invoke
サブクラスは、アドバイスの前後でカスタム動作を実行する場合、これをオーバーライドする必要がある場合があります。ただし、サブクラスはこのメソッドを呼び出す必要があります。このメソッドは、導入されたインターフェースとターゲットへの転送を処理します。- 次で指定:
- インターフェース
MethodInterceptor
のinvoke
- パラメーター:
mi
- メソッド呼び出しジョインポイント- 戻り値:
Joinpoint.proceed()
の呼び出しの結果。インターセプターによってインターセプトされる可能性があります- 例外:
ThrowableSE
- インターセプターまたはターゲットオブジェクトが例外をスローする場合
doProceed
付属のMethodInterceptor
を続行します。サブクラスは、このメソッドをオーバーライドして、ターゲットオブジェクトでのメソッド呼び出しをインターセプトできます。これは、イントロダクションが導入されるオブジェクトを監視する必要がある場合に役立ちます。このメソッドは、導入されたインターフェースのMethodInvocations
に対して呼び出されることはありません。- 例外:
ThrowableSE