org.apache.webbeans.component
Class InterceptorBean<T>

java.lang.Object
  extended by org.apache.webbeans.component.BeanAttributesImpl<T>
      extended by org.apache.webbeans.component.AbstractOwbBean<T>
          extended by org.apache.webbeans.component.InjectionTargetBean<T>
              extended by org.apache.webbeans.component.InterceptorBean<T>
All Implemented Interfaces:
Contextual<T>, Bean<T>, Interceptor<T>, PassivationCapable, OwbBean<T>, BeanAttributes<T>
Direct Known Subclasses:
CdiInterceptorBean, EjbInterceptorBean, SelfInterceptorBean

public abstract class InterceptorBean<T>
extends InjectionTargetBean<T>
implements Interceptor<T>

Abstract Interceptor Bean implementation.

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


Nested Class Summary
static class InterceptorBean.MultiMethodInvocationContext
          An InvocationContext wraper for handling multiple interceptor methods.
 
Field Summary
protected  Method aroundConstructMethod
           
protected  Method aroundInvokeMethod
          This is for performance reasons
 
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
enabled, logger, passivatingId, specializedBean, webBeansContext, webBeansType
 
Constructor Summary
protected InterceptorBean(WebBeansContext webBeansContext, AnnotatedType<T> annotatedType, BeanAttributes<T> beanAttributes, Class<T> beanClass, Map<InterceptionType,Method[]> interceptionMethods, Method aroundConstruct, InjectionTargetFactoryImpl<T> factory)
           
  InterceptorBean(WebBeansContext webBeansContext, AnnotatedType<T> annotatedType, BeanAttributesImpl<T> beanAttributes, Class<T> beanClass, Map<InterceptionType,Method[]> interceptionMethods, Method aroundConstructMethod)
           
 
Method Summary
 Method[] getInterceptorMethods(InterceptionType interceptionType)
           
 Class<? extends Annotation> getScope()
          Interceptors are by default @Dependent scoped.
 Object intercept(InterceptionType interceptionType, T instance, InvocationContext invocationContext)
           
 boolean intercepts(InterceptionType interceptionType)
           
 
Methods inherited from class org.apache.webbeans.component.InjectionTargetBean
getAnnotatedType, getInjectionTarget, getProducer
 
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
create, destroy, getBeanClass, getId, getInjectionPoints, getLogger, getReturnType, getWebBeansContext, getWebBeansType, isAlternative, isDependent, isEnabled, isPassivationCapable, isSpecializedBean, setEnabled, setSpecializedBean, toString
 
Methods inherited from class org.apache.webbeans.component.BeanAttributesImpl
getName, getQualifiers, getStereotypes, getTypes, isNullable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.enterprise.inject.spi.Interceptor
getInterceptorBindings
 
Methods inherited from interface javax.enterprise.inject.spi.Bean
getBeanClass, getInjectionPoints, getName, getQualifiers, getStereotypes, getTypes, isAlternative, isNullable
 
Methods inherited from interface javax.enterprise.context.spi.Contextual
create, destroy
 

Field Detail

aroundInvokeMethod

protected Method aroundInvokeMethod
This is for performance reasons


aroundConstructMethod

protected Method aroundConstructMethod
Constructor Detail

InterceptorBean

protected InterceptorBean(WebBeansContext webBeansContext,
                          AnnotatedType<T> annotatedType,
                          BeanAttributes<T> beanAttributes,
                          Class<T> beanClass,
                          Map<InterceptionType,Method[]> interceptionMethods,
                          Method aroundConstruct,
                          InjectionTargetFactoryImpl<T> factory)

InterceptorBean

public InterceptorBean(WebBeansContext webBeansContext,
                       AnnotatedType<T> annotatedType,
                       BeanAttributesImpl<T> beanAttributes,
                       Class<T> beanClass,
                       Map<InterceptionType,Method[]> interceptionMethods,
                       Method aroundConstructMethod)
Method Detail

getScope

public Class<? extends Annotation> getScope()
Interceptors are by default @Dependent scoped.

Specified by:
getScope in interface Bean<T>
Specified by:
getScope in interface BeanAttributes<T>
Overrides:
getScope in class BeanAttributesImpl<T>

getInterceptorMethods

public Method[] getInterceptorMethods(InterceptionType interceptionType)
Parameters:
interceptionType -
Returns:
the underlying interceptor method for the given InterceptionType or null

intercepts

public boolean intercepts(InterceptionType interceptionType)
Specified by:
intercepts in interface Interceptor<T>

intercept

public Object intercept(InterceptionType interceptionType,
                        T instance,
                        InvocationContext invocationContext)
Specified by:
intercept in interface Interceptor<T>


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.