インターフェース Interceptor

すべてのスーパーインターフェース:
Advice
すべての既知のサブインターフェース:
ConstructorInterceptor, IntroductionInterceptor, MethodInterceptor
すべての既知の実装クラス:
AbstractMonitoringInterceptor, AbstractRetryInterceptor, AbstractTraceInterceptor, AfterReturningAdviceInterceptor, AnnotationAsyncExecutionInterceptor, AspectJAfterAdvice, AspectJAfterThrowingAdvice, AspectJAroundAdvice, AsyncExecutionInterceptor, CacheInterceptor, ConcurrencyThrottleInterceptor, CustomizableTraceInterceptor, DebugInterceptor, DelegatePerTargetObjectIntroductionInterceptor, DelegatingIntroductionInterceptor, EventPublicationInterceptor, ExposeInvocationInterceptor, JCacheInterceptor, MBeanClientInterceptor, MBeanProxyFactoryBean, MethodBeforeAdviceInterceptor, MethodValidationInterceptor, PerformanceMonitorInterceptor, PersistenceExceptionTranslationInterceptor, SimpleRetryInterceptor, SimpleTraceInterceptor, ThrowsAdviceInterceptor, TransactionInterceptor

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
関連事項: