Package org.jboss.weld.bean
Class AbstractClassBean<T>
- java.lang.Object
-
- org.jboss.weld.util.bean.ForwardingBeanAttributes<T>
-
- org.jboss.weld.bean.CommonBean<T>
-
- org.jboss.weld.bean.RIBean<T>
-
- org.jboss.weld.bean.AbstractBean<T,Class<T>>
-
- org.jboss.weld.bean.AbstractClassBean<T>
-
- Type Parameters:
T- the type of class for the bean
- All Implemented Interfaces:
Contextual<T>,Bean<T>,BeanAttributes<T>,PassivationCapable,ClassBean<T>,DecorableBean<T>,WeldBean<T>
- Direct Known Subclasses:
ManagedBean
public abstract class AbstractClassBean<T> extends AbstractBean<T,Class<T>> implements DecorableBean<T>, ClassBean<T>
An abstract bean representation common for class-based beans- Author:
- Pete Muir, David Allen, Jozef Hartinger
-
-
Field Summary
Fields Modifier and Type Field Description protected SlimAnnotatedType<T>annotatedTypeprotected EnhancedAnnotatedType<T>enhancedAnnotatedItem-
Fields inherited from class org.jboss.weld.bean.AbstractBean
type
-
Fields inherited from class org.jboss.weld.bean.RIBean
beanManager
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractClassBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, org.jboss.weld.serialization.spi.BeanIdentifier identifier, BeanManagerImpl beanManager)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckBeanImplementation()Validates the bean implementationvoidcleanupAfterBoot()This method is called after the container is started allowing the bean to release any resources that are only required at boot timeSlimAnnotatedType<T>getAnnotated()Returns the annotated item the bean representsList<Decorator<?>>getDecorators()Resolves decorators for this bean.EnhancedAnnotatedType<T>getEnhancedAnnotated()Gets the annotated itemSet<InjectionPoint>getInjectionPoints()Obtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.InjectionTarget<T>getInjectionTarget()Duplicate ofgetProducer()- kept for backwards compatibility.InterceptionModelgetInterceptors()InjectionTarget<T>getProducer()Returns injection target used to produce instances of this beanbooleanhasDecorators()booleanhasInterceptors()protected voidinitType()Initializes the bean typevoidinternalInitialize(BeanDeployerEnvironment environment)Initializes the bean and its metadataprotected abstract booleanisInterceptionCandidate()protected voidpreSpecialize()voidsetInjectionTarget(InjectionTarget<T> injectionTarget)voidsetProducer(InjectionTarget<T> producer)voidsetProducer(Producer<T> producer)Set a Producer for this bean.-
Methods inherited from class org.jboss.weld.bean.AbstractBean
checkSpecialization, checkType, getSpecializedBeans, getType, initializeAfterBeanDiscovery, isDependent, isIgnoreFinalMethods, isProxyRequired, isSpecializing, postSpecialize, preInitialize, setIgnoreFinalMethods, specialize
-
Methods inherited from class org.jboss.weld.bean.RIBean
destroy, getBeanClass, getBeanManager, getContextualInstanceStrategy, getQualifierInstances, initialize, isNormalScoped, isPassivationCapableBean, isPassivationCapableDependency, isProxyable, setAttributes
-
Methods inherited from class org.jboss.weld.bean.CommonBean
attributes, equals, getId, getIdentifier, hashCode, isNullable, toString, unwrap
-
Methods inherited from class org.jboss.weld.util.bean.ForwardingBeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.spi.Bean
getBeanClass, isNullable
-
Methods inherited from interface javax.enterprise.inject.spi.BeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
Methods inherited from interface org.jboss.weld.bean.ClassBean
getBeanManager
-
Methods inherited from interface javax.enterprise.context.spi.Contextual
create, destroy
-
Methods inherited from interface javax.enterprise.inject.spi.PassivationCapable
getId
-
Methods inherited from interface org.jboss.weld.bean.WeldBean
getIdentifier, getPriority
-
-
-
-
Field Detail
-
annotatedType
protected final SlimAnnotatedType<T> annotatedType
-
enhancedAnnotatedItem
protected volatile EnhancedAnnotatedType<T> enhancedAnnotatedItem
-
-
Constructor Detail
-
AbstractClassBean
protected AbstractClassBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, org.jboss.weld.serialization.spi.BeanIdentifier identifier, BeanManagerImpl beanManager)
Constructor- Parameters:
type- The typebeanManager- The Bean manager
-
-
Method Detail
-
internalInitialize
public void internalInitialize(BeanDeployerEnvironment environment)
Initializes the bean and its metadata- Overrides:
internalInitializein classAbstractBean<T,Class<T>>
-
hasDecorators
public boolean hasDecorators()
-
getDecorators
public List<Decorator<?>> getDecorators()
Description copied from interface:DecorableBeanResolves decorators for this bean.- Specified by:
getDecoratorsin interfaceDecorableBean<T>
-
initType
protected void initType()
Initializes the bean type
-
checkBeanImplementation
protected void checkBeanImplementation()
Validates the bean implementation
-
preSpecialize
protected void preSpecialize()
- Overrides:
preSpecializein classAbstractBean<T,Class<T>>
-
getAnnotated
public SlimAnnotatedType<T> getAnnotated()
Description copied from class:AbstractBeanReturns the annotated item the bean represents- Specified by:
getAnnotatedin interfaceClassBean<T>- Specified by:
getAnnotatedin classAbstractBean<T,Class<T>>- Returns:
- The annotated item
-
getEnhancedAnnotated
public EnhancedAnnotatedType<T> getEnhancedAnnotated()
Gets the annotated item- Specified by:
getEnhancedAnnotatedin interfaceClassBean<T>- Specified by:
getEnhancedAnnotatedin classAbstractBean<T,Class<T>>- Returns:
- The annotated item
-
cleanupAfterBoot
public void cleanupAfterBoot()
Description copied from class:RIBeanThis method is called after the container is started allowing the bean to release any resources that are only required at boot time- Specified by:
cleanupAfterBootin classRIBean<T>
-
isInterceptionCandidate
protected abstract boolean isInterceptionCandidate()
-
getInjectionPoints
public Set<InjectionPoint> getInjectionPoints()
Description copied from interface:BeanObtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.- Specified by:
getInjectionPointsin interfaceBean<T>- Returns:
- the set of injection points of the bean
-
getInterceptors
public InterceptionModel getInterceptors()
-
hasInterceptors
public boolean hasInterceptors()
-
getProducer
public InjectionTarget<T> getProducer()
Description copied from interface:ClassBeanReturns injection target used to produce instances of this bean- Specified by:
getProducerin interfaceClassBean<T>- Overrides:
getProducerin classAbstractBean<T,Class<T>>- Returns:
- the injection target
-
setProducer
public void setProducer(InjectionTarget<T> producer)
-
getInjectionTarget
public InjectionTarget<T> getInjectionTarget()
Duplicate ofgetProducer()- kept for backwards compatibility.
-
setInjectionTarget
public void setInjectionTarget(InjectionTarget<T> injectionTarget)
-
setProducer
public void setProducer(Producer<T> producer)
Description copied from class:AbstractBeanSet a Producer for this bean. This operation is *not* threadsafe, and should not be called outside bootstrap.- Overrides:
setProducerin classAbstractBean<T,Class<T>>
-
-