Class InterceptorBeanBuilder<T,B extends InterceptorBean<T>>
- java.lang.Object
-
- org.apache.webbeans.component.creation.AbstractBeanBuilder
-
- org.apache.webbeans.component.creation.InterceptorBeanBuilder<T,B>
-
- Direct Known Subclasses:
CdiInterceptorBeanBuilder,EjbInterceptorBeanBuilder,SelfInterceptorBeanBuilder
public abstract class InterceptorBeanBuilder<T,B extends InterceptorBean<T>> extends AbstractBeanBuilder
Bean builder forInterceptorBeans.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.enterprise.inject.spi.AnnotatedType<T>annotatedTypeprotected javax.enterprise.inject.spi.BeanAttributes<T>beanAttributesprotected Map<javax.enterprise.inject.spi.InterceptionType,Method[]>interceptionMethodsprotected WebBeansContextwebBeansContext
-
Constructor Summary
Constructors Modifier Constructor Description protectedInterceptorBeanBuilder(WebBeansContext webBeansContext, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckInterceptorConditions()protected abstract BcreateBean(Class<T> beanClass, boolean enabled, Map<javax.enterprise.inject.spi.InterceptionType,Method[]> interceptionMethods)booleandefineInterceptorMethods()Grab all methods which act as interceptors for the variousInterceptionTypes.BgetBean()abstract booleanisInterceptorEnabled()If this method returnsfalsethegetBean()method must not get called.-
Methods inherited from class org.apache.webbeans.component.creation.AbstractBeanBuilder
validateNoDisposerWithoutProducer, validateNoProducerOrObserverMethod
-
-
-
-
Field Detail
-
webBeansContext
protected final WebBeansContext webBeansContext
-
annotatedType
protected final javax.enterprise.inject.spi.AnnotatedType<T> annotatedType
-
beanAttributes
protected final javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes
-
-
Constructor Detail
-
InterceptorBeanBuilder
protected InterceptorBeanBuilder(WebBeansContext webBeansContext, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes)
-
-
Method Detail
-
isInterceptorEnabled
public abstract boolean isInterceptorEnabled()
If this method returnsfalsethegetBean()method must not get called.- Returns:
trueif the Interceptor is enabled and a Bean should get created
-
checkInterceptorConditions
protected void checkInterceptorConditions()
-
defineInterceptorMethods
public boolean defineInterceptorMethods()
Grab all methods which act as interceptors for the various
InterceptionTypes.This method will also check some rules, e.g. that there must not be more than a single
AroundInvokemethod on a class.For the interceptors where multiple are allowed, the following rules apply:
- Superclass methods first
- Non-private methods override and derogates their superclass counterparts.
- Private methods with the same signature stack (superclass first).
- There must only be a single method for each InterceptorType in the same class.
- Returns:
trueif we found some interceptor methods
-
createBean
protected abstract B createBean(Class<T> beanClass, boolean enabled, Map<javax.enterprise.inject.spi.InterceptionType,Method[]> interceptionMethods)
-
getBean
public B getBean()
-
-