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:
jakarta.enterprise.context.spi.Contextual<T>
,jakarta.enterprise.inject.spi.Bean<T>
,jakarta.enterprise.inject.spi.BeanAttributes<T>
,jakarta.enterprise.inject.spi.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 protected
ManagedBean(jakarta.enterprise.inject.spi.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 void
checkBeanImplementation()
Validates the bean implementationprotected void
checkType()
Validates the typeT
create(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates an instance of the beanvoid
destroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
Destroys an instance of the beanvoid
initializeAfterBeanDiscovery()
In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g.void
internalInitialize(BeanDeployerEnvironment environment)
Initializes the bean and its metadataprotected boolean
isInterceptionCandidate()
boolean
isPassivationCapableBean()
boolean
isPassivationCapableDependency()
boolean
isProxyable()
static <T> ManagedBean<T>
of(jakarta.enterprise.inject.spi.BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager)
Creates a simple, annotation defined Web Beanvoid
setProducer(jakarta.enterprise.inject.spi.InjectionTarget<T> producer)
protected void
specialize()
String
toString()
-
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 jakarta.enterprise.inject.spi.BeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
Methods inherited from interface org.jboss.weld.bean.ClassBean
getBeanManager
-
Methods inherited from interface org.jboss.weld.bean.WeldBean
getIdentifier, getPriority
-
-
-
-
Constructor Detail
-
ManagedBean
protected ManagedBean(jakarta.enterprise.inject.spi.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(jakarta.enterprise.inject.spi.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:AbstractClassBean
Initializes the bean and its metadata- Overrides:
internalInitialize
in classAbstractClassBean<T>
-
initializeAfterBeanDiscovery
public void initializeAfterBeanDiscovery()
Description copied from class:RIBean
In 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:
initializeAfterBeanDiscovery
in classAbstractBean<T,Class<T>>
-
create
public T create(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates an instance of the bean- Returns:
- The instance
-
destroy
public void destroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
Destroys an instance of the bean
-
checkType
protected void checkType()
Validates the type- Specified by:
checkType
in classAbstractBean<T,Class<T>>
-
checkBeanImplementation
protected void checkBeanImplementation()
Description copied from class:AbstractClassBean
Validates the bean implementation- Overrides:
checkBeanImplementation
in classAbstractClassBean<T>
-
specialize
protected void specialize()
- Overrides:
specialize
in classAbstractBean<T,Class<T>>
-
isInterceptionCandidate
protected boolean isInterceptionCandidate()
- Specified by:
isInterceptionCandidate
in classAbstractClassBean<T>
-
toString
public String toString()
- Overrides:
toString
in classCommonBean<T>
-
isProxyable
public boolean isProxyable()
- Specified by:
isProxyable
in classRIBean<T>
-
isPassivationCapableBean
public boolean isPassivationCapableBean()
- Specified by:
isPassivationCapableBean
in classRIBean<T>
-
isPassivationCapableDependency
public boolean isPassivationCapableDependency()
- Specified by:
isPassivationCapableDependency
in classRIBean<T>
-
setProducer
public void setProducer(jakarta.enterprise.inject.spi.InjectionTarget<T> producer)
- Overrides:
setProducer
in classAbstractClassBean<T>
-
-