Package org.jboss.weld.bean
Class AbstractBean<T,S>
- 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,S>
-
- Type Parameters:
T
- the type of beanS
- the Class> of the bean type
- 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
,WeldBean<T>
- Direct Known Subclasses:
AbstractClassBean
,AbstractProducerBean
public abstract class AbstractBean<T,S> extends RIBean<T>
An abstract bean representation common for all beans- Author:
- Pete Muir, Ales Justin, Jozef Hartinger
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<T>
type
-
Fields inherited from class org.jboss.weld.bean.RIBean
beanManager
-
-
Constructor Summary
Constructors Constructor Description AbstractBean(jakarta.enterprise.inject.spi.BeanAttributes<T> attributes, 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 void
checkSpecialization()
Validates specialization if this bean specializes another bean.protected abstract void
checkType()
abstract jakarta.enterprise.inject.spi.Annotated
getAnnotated()
Returns the annotated item the bean representsabstract EnhancedAnnotated<T,S>
getEnhancedAnnotated()
Returns the weld-enhanced annotated item the bean represents.jakarta.enterprise.inject.spi.Producer<T>
getProducer()
protected Set<? extends AbstractBean<?,?>>
getSpecializedBeans()
Class<T>
getType()
Gets the type 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 metadataboolean
isDependent()
boolean
isIgnoreFinalMethods()
boolean
isProxyRequired()
boolean
isSpecializing()
protected void
postSpecialize()
void
preInitialize()
Initializes specialization.protected void
preSpecialize()
void
setIgnoreFinalMethods()
void
setProducer(jakarta.enterprise.inject.spi.Producer<T> producer)
Set a Producer for this bean.protected void
specialize()
-
Methods inherited from class org.jboss.weld.bean.RIBean
cleanupAfterBoot, 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 jakarta.enterprise.inject.spi.BeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
Methods inherited from interface org.jboss.weld.bean.WeldBean
getPriority
-
-
-
-
Constructor Detail
-
AbstractBean
public AbstractBean(jakarta.enterprise.inject.spi.BeanAttributes<T> attributes, org.jboss.weld.serialization.spi.BeanIdentifier identifier, BeanManagerImpl beanManager)
Constructor- Parameters:
beanManager
- The Bean manager
-
-
Method Detail
-
preInitialize
public void preInitialize()
Initializes specialization. This method is called beforeProcessBeanAttributes
is fired and also after the event if theBeanAttributes
have been altered.- Specified by:
preInitialize
in classRIBean<T>
-
internalInitialize
public void internalInitialize(BeanDeployerEnvironment environment)
Initializes the bean and its metadata- Specified by:
internalInitialize
in classRIBean<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)- Specified by:
initializeAfterBeanDiscovery
in classRIBean<T>
-
checkType
protected abstract void checkType()
-
checkSpecialization
public void checkSpecialization()
Validates specialization if this bean specializes another bean.
-
postSpecialize
protected void postSpecialize()
-
preSpecialize
protected void preSpecialize()
-
specialize
protected void specialize()
-
getAnnotated
public abstract jakarta.enterprise.inject.spi.Annotated getAnnotated()
Returns the annotated item the bean represents- Returns:
- The annotated item
-
getEnhancedAnnotated
public abstract EnhancedAnnotated<T,S> getEnhancedAnnotated()
Returns the weld-enhanced annotated item the bean represents. The item is only available during bootstrap. The method throwsIllegalStateException
at runtime.- Returns:
- The annotated item
- Throws:
IllegalStateException
- when invoked at runtime
-
getSpecializedBeans
protected Set<? extends AbstractBean<?,?>> getSpecializedBeans()
-
isDependent
public boolean isDependent()
- Overrides:
isDependent
in classRIBean<T>
-
isSpecializing
public boolean isSpecializing()
-
isProxyRequired
public boolean isProxyRequired()
- Specified by:
isProxyRequired
in classRIBean<T>
-
getProducer
public jakarta.enterprise.inject.spi.Producer<T> getProducer()
-
setProducer
public void setProducer(jakarta.enterprise.inject.spi.Producer<T> producer)
Set a Producer for this bean. This operation is *not* threadsafe, and should not be called outside bootstrap.
-
isIgnoreFinalMethods
public boolean isIgnoreFinalMethods()
-
setIgnoreFinalMethods
public void setIgnoreFinalMethods()
-
-