public class DelegatingIntroductionInterceptor extends IntroductionInfoSupport implements IntroductionInterceptor
IntroductionInterceptor インターフェースの便利な実装。サブクラスは、このクラスを継承し、自分で導入するインターフェースを実装するだけで済みます。この場合、デリゲートはサブクラスインスタンス自体です。または、別のデリゲートがインターフェースを実装し、デリゲート Bean プロパティを介して設定することもできます。
デリゲートまたはサブクラスは、任意の数のインターフェースを実装できます。IntroductionInterceptor を除くすべてのインターフェースは、デフォルトでサブクラスまたはデリゲートから取得されます。
suppressInterface メソッドは、デリゲートによって実装されたインターフェースを抑制するために使用できますが、所有している AOP プロキシに導入すべきではありません。
デリゲートがシリアライズ可能な場合、このクラスのインスタンスはシリアライズ可能です。
IntroductionInfoSupport.suppressInterface(java.lang.Class<?>), DelegatePerTargetObjectIntroductionInterceptor, 連載形式 publishedInterfaces| 修飾子 | コンストラクターと説明 |
|---|---|
protected | DelegatingIntroductionInterceptor() 新しい DelegatingIntroductionInterceptor を作成します。 |
| DelegatingIntroductionInterceptor(ObjectSE delegate) 導入するインターフェースを実装するデリゲートを提供して、新しい DelegatingIntroductionInterceptor を構築します。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected ObjectSE | doProceed(MethodInvocation mi) 提供された MethodInterceptor に進みます。 |
ObjectSE | invoke(MethodInvocation mi) サブクラスは、アラウンドアドバイスでカスタム動作を実行する場合、これをオーバーライドする必要があります。 |
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterfacecloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEimplementsInterfacepublic DelegatingIntroductionInterceptor(ObjectSE delegate)
delegate - 導入されたインターフェースを実装するデリゲート protected DelegatingIntroductionInterceptor()
@Nullable public ObjectSE invoke(MethodInvocation mi) throws ThrowableSE
MethodInterceptor の invoke mi - メソッド呼び出しジョインポイント Joinpoint.proceed() の呼び出しの結果。インターセプターによってインターセプトされる可能性があります ThrowableSE - インターセプターまたはターゲットオブジェクトが例外をスローする場合 @Nullable protected ObjectSE doProceed(MethodInvocation mi) throws ThrowableSE
MethodInterceptor を続行します。サブクラスは、このメソッドをオーバーライドして、ターゲットオブジェクトでのメソッド呼び出しをインターセプトできます。これは、イントロダクションが導入されるオブジェクトを監視する必要がある場合に役立ちます。このメソッドは、導入されたインターフェースの MethodInvocations に対して呼び出されることはありません。ThrowableSE