パッケージ org.aopalliance.intercept

インターフェース Interceptor

すべてのスーパーインターフェース:
Advice
すべての既知のサブインターフェース:
ConstructorInterceptorIntroductionInterceptorMethodInterceptor
すべての既知の実装クラス:
AbstractMonitoringInterceptorAbstractTraceInterceptorAfterReturningAdviceInterceptorAnnotationAsyncExecutionInterceptorAspectJAfterAdviceAspectJAfterThrowingAdviceAspectJAroundAdviceAsyncExecutionInterceptorCacheInterceptorConcurrencyThrottleInterceptorCustomizableTraceInterceptorDebugInterceptorDelegatePerTargetObjectIntroductionInterceptorDelegatingIntroductionInterceptorEventPublicationInterceptorExposeInvocationInterceptorJCacheInterceptorMBeanClientInterceptorMBeanProxyFactoryBeanMethodBeforeAdviceInterceptorMethodValidationInterceptorOpenSessionInterceptorPerformanceMonitorInterceptorPersistenceExceptionTranslationInterceptorSimpleTraceInterceptorThrowsAdviceInterceptorTransactionInterceptor

public interface Interceptor extends Advice
このインターフェースは、汎用インターセプターを表します。

汎用インターセプターは、基本プログラム内で発生するランタイムイベントをインターセプトできます。これらのイベントは、ジョインポイントによって(具体化されて)実現されます。ランタイムジョインポイントは、呼び出し、フィールドアクセス、例外などです。

このインターフェースは直接使用されません。サブインターフェースを使用して特定のイベントをインターセプトします。たとえば、次のクラスは、デバッガーを実装するために特定のインターセプターを実装しています。

 class DebuggingInterceptor implements MethodInterceptor,
     ConstructorInterceptor {

   Object invoke(MethodInvocation i) throws Throwable {
     debug(i.getMethod(), i.getThis(), i.getArgs());
     return i.proceed();
   }

   Object construct(ConstructorInvocation i) throws Throwable {
     debug(i.getConstructor(), i.getThis(), i.getArgs());
     return i.proceed();
   }

   void debug(AccessibleObject ao, Object this, Object value) {
     ...
   }
 }
 
作成者:
Rod Johnson
関連事項: