Class InterceptorBean<T>

  • All Implemented Interfaces:
    jakarta.enterprise.context.spi.Contextual<T>, jakarta.enterprise.inject.spi.Bean<T>, jakarta.enterprise.inject.spi.BeanAttributes<T>, jakarta.enterprise.inject.spi.Interceptor<T>, jakarta.enterprise.inject.spi.PassivationCapable, Serializable, OwbBean<T>
    Direct Known Subclasses:
    CdiInterceptorBean, EjbInterceptorBean, SelfInterceptorBean

    public abstract class InterceptorBean<T>
    extends InjectionTargetBean<T>
    implements jakarta.enterprise.inject.spi.Interceptor<T>

    Abstract Interceptor Bean implementation.

    Any Interceptor is also an InjectionTarget as they can contain @Inject InjectionPoints.

    See Also:
    Serialized Form
    • Field Detail

      • aroundInvokeMethod

        protected Method aroundInvokeMethod
        This is for performance reasons
    • Constructor Detail

      • InterceptorBean

        protected InterceptorBean​(WebBeansContext webBeansContext,
                                  jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType,
                                  jakarta.enterprise.inject.spi.BeanAttributes<T> beanAttributes,
                                  Class<T> beanClass,
                                  Map<jakarta.enterprise.inject.spi.InterceptionType,​Method[]> interceptionMethods,
                                  InjectionTargetFactoryImpl<T> factory)
      • InterceptorBean

        public InterceptorBean​(WebBeansContext webBeansContext,
                               jakarta.enterprise.inject.spi.AnnotatedType<T> annotatedType,
                               jakarta.enterprise.inject.spi.BeanAttributes<T> beanAttributes,
                               Class<T> beanClass,
                               Map<jakarta.enterprise.inject.spi.InterceptionType,​Method[]> interceptionMethods)
    • Method Detail

      • getScope

        public Class<? extends Annotation> getScope()
        Interceptors are by default @Dependent scoped.
        Specified by:
        getScope in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
        Overrides:
        getScope in class BeanAttributesImpl<T>
      • getInterceptorMethods

        public Method[] getInterceptorMethods​(jakarta.enterprise.inject.spi.InterceptionType interceptionType)
        Parameters:
        interceptionType -
        Returns:
        the underlying interceptor method for the given InterceptionType or null
      • intercepts

        public boolean intercepts​(jakarta.enterprise.inject.spi.InterceptionType interceptionType)
        Specified by:
        intercepts in interface jakarta.enterprise.inject.spi.Interceptor<T>
      • intercept

        public Object intercept​(jakarta.enterprise.inject.spi.InterceptionType interceptionType,
                                T instance,
                                jakarta.interceptor.InvocationContext invocationContext)
        Specified by:
        intercept in interface jakarta.enterprise.inject.spi.Interceptor<T>