Package org.jboss.weld.bean
Class ManagedBean<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>
-
- org.jboss.weld.bean.ManagedBean<T>
-
- Type Parameters:
T- The type (class) of the bean
- All Implemented Interfaces:
Contextual<T>,Bean<T>,BeanAttributes<T>,PassivationCapable,ClassBean<T>,DecorableBean<T>,WeldBean<T>
- Direct Known Subclasses:
DecoratorImpl,InterceptorImpl,NewManagedBean
public class ManagedBean<T> extends AbstractClassBean<T>
Represents a simple bean- Author:
- Pete Muir, Marius Bogoevici, Ales Justin, Marko Luksa, Laird Nelson
-
-
Field Summary
-
Fields inherited from class org.jboss.weld.bean.AbstractClassBean
annotatedType, 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 protectedManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, org.jboss.weld.serialization.spi.BeanIdentifier identifier, BeanManagerImpl beanManager)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckBeanImplementation()Validates the bean implementationprotected voidcheckType()Validates the typeTcreate(CreationalContext<T> creationalContext)Creates an instance of the beanvoiddestroy(T instance, CreationalContext<T> creationalContext)Destroys an instance of the beanvoidinitializeAfterBeanDiscovery()In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g.voidinternalInitialize(BeanDeployerEnvironment environment)Initializes the bean and its metadataprotected booleanisInterceptionCandidate()booleanisPassivationCapableBean()booleanisPassivationCapableDependency()booleanisProxyable()static <T> ManagedBean<T>of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager)Creates a simple, annotation defined Web BeanvoidsetProducer(InjectionTarget<T> producer)protected voidspecialize()StringtoString()-
Methods inherited from class org.jboss.weld.bean.AbstractClassBean
cleanupAfterBoot, getAnnotated, getDecorators, getEnhancedAnnotated, getInjectionPoints, getInjectionTarget, getInterceptors, getProducer, hasDecorators, hasInterceptors, initType, preSpecialize, setInjectionTarget, setProducer
-
Methods inherited from class org.jboss.weld.bean.AbstractBean
checkSpecialization, getSpecializedBeans, getType, isDependent, isIgnoreFinalMethods, isProxyRequired, isSpecializing, postSpecialize, preInitialize, setIgnoreFinalMethods
-
Methods inherited from class org.jboss.weld.bean.RIBean
getBeanClass, getBeanManager, getContextualInstanceStrategy, getQualifierInstances, initialize, isNormalScoped, setAttributes
-
Methods inherited from class org.jboss.weld.bean.CommonBean
attributes, equals, getId, getIdentifier, hashCode, isNullable, 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.inject.spi.PassivationCapable
getId
-
Methods inherited from interface org.jboss.weld.bean.WeldBean
getIdentifier, getPriority
-
-
-
-
Constructor Detail
-
ManagedBean
protected ManagedBean(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, org.jboss.weld.serialization.spi.BeanIdentifier identifier, BeanManagerImpl beanManager)
Constructor- Parameters:
type- The type of the beanbeanManager- The Bean manager
-
-
Method Detail
-
of
public static <T> ManagedBean<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager)
Creates a simple, annotation defined Web Bean- Type Parameters:
T- The type- Parameters:
clazz- The classbeanManager- the current manager- Returns:
- A Web Bean
-
internalInitialize
public void internalInitialize(BeanDeployerEnvironment environment)
Description copied from class:AbstractClassBeanInitializes the bean and its metadata- Overrides:
internalInitializein classAbstractClassBean<T>
-
initializeAfterBeanDiscovery
public void initializeAfterBeanDiscovery()
Description copied from class:RIBeanIn particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g. for initializing decorators taking into account the possibility of having custom decorators which are deployed through portable extensions)- Overrides:
initializeAfterBeanDiscoveryin classAbstractBean<T,Class<T>>
-
create
public T create(CreationalContext<T> creationalContext)
Creates an instance of the bean- Parameters:
creationalContext- the context in which this instance is being created- Returns:
- The instance
-
destroy
public void destroy(T instance, CreationalContext<T> creationalContext)
Destroys an instance of the bean
-
checkType
protected void checkType()
Validates the type- Specified by:
checkTypein classAbstractBean<T,Class<T>>
-
checkBeanImplementation
protected void checkBeanImplementation()
Description copied from class:AbstractClassBeanValidates the bean implementation- Overrides:
checkBeanImplementationin classAbstractClassBean<T>
-
specialize
protected void specialize()
- Overrides:
specializein classAbstractBean<T,Class<T>>
-
isInterceptionCandidate
protected boolean isInterceptionCandidate()
- Specified by:
isInterceptionCandidatein classAbstractClassBean<T>
-
toString
public String toString()
- Overrides:
toStringin classCommonBean<T>
-
isProxyable
public boolean isProxyable()
- Specified by:
isProxyablein classRIBean<T>
-
isPassivationCapableBean
public boolean isPassivationCapableBean()
- Specified by:
isPassivationCapableBeanin classRIBean<T>
-
isPassivationCapableDependency
public boolean isPassivationCapableDependency()
- Specified by:
isPassivationCapableDependencyin classRIBean<T>
-
setProducer
public void setProducer(InjectionTarget<T> producer)
- Overrides:
setProducerin classAbstractClassBean<T>
-
-