Interface InterceptorCreator

All Known Implementing Classes:
DefaultInterceptorCreator

@Contract public interface InterceptorCreator
Provides the strategy used to determine which annotations cause interceptor creation. Only services that are pico- activated may qualify for interception.
See Also:
  • Method Details

    • strategy

      default InterceptorCreator.Strategy strategy()
      Determines the strategy being applied.
      Returns:
      the strategy being applied
    • allowListedAnnotationTypes

      default Set<String> allowListedAnnotationTypes()
      Applicable when InterceptorCreator.Strategy.ALLOW_LISTED is in use.
      Returns:
      the set of type names that should trigger creation
    • isAllowListed

      default boolean isAllowListed(String annotationType)
      Applicable when InterceptorCreator.Strategy.CUSTOM is in use.
      Parameters:
      annotationType - the annotation type name
      Returns:
      true if the annotation type should trigger interceptor creation
    • createInterceptorPlan

      Optional<InterceptionPlan> createInterceptorPlan(ServiceInfoBasics interceptedService, ProcessingEnvironment processingEnvironment, Set<String> annotationTypeTriggers)
      After an annotation qualifies the enclosing service for interception, this method will be used to provide the injection plan that applies to that service type.
      Parameters:
      interceptedService - the service being intercepted
      processingEnvironment - optionally, the processing environment (if being called by annotation processing)
      annotationTypeTriggers - the set of annotation names that are associated with interception.
      Returns:
      the injection plan, or empty for the implementation to use the default strategy for creating a plan
    • createInterceptorProcessor

      InterceptorCreator.InterceptorProcessor createInterceptorProcessor(ServiceInfoBasics interceptedService, InterceptorCreator delegateCreator, Optional<ProcessingEnvironment> processEnv)
      Returns the processor appropriate for the context revealed in the calling arguments, favoring reflection if the serviceTypeElement is provided.
      Parameters:
      interceptedService - the service being intercepted
      delegateCreator - the "real" creator
      processEnv - optionally, the processing environment (should be passed if in annotation processor)
      Returns:
      the processor to use for the given arguments