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