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:
Contextual<T>,Bean<T>,BeanAttributes<T>,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(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 voidcheckSpecialization()Validates specialization if this bean specializes another bean.protected abstract voidcheckType()abstract AnnotatedgetAnnotated()Returns the annotated item the bean representsabstract EnhancedAnnotated<T,S>getEnhancedAnnotated()Returns the weld-enhanced annotated item the bean represents.Producer<T>getProducer()protected Set<? extends AbstractBean<?,?>>getSpecializedBeans()Class<T>getType()Gets the type 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 metadatabooleanisDependent()booleanisIgnoreFinalMethods()booleanisProxyRequired()booleanisSpecializing()protected voidpostSpecialize()voidpreInitialize()Initializes specialization.protected voidpreSpecialize()voidsetIgnoreFinalMethods()voidsetProducer(Producer<T> producer)Set a Producer for this bean.protected voidspecialize()-
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 javax.enterprise.inject.spi.Bean
getInjectionPoints
-
Methods inherited from interface javax.enterprise.inject.spi.BeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
-
Methods inherited from interface javax.enterprise.context.spi.Contextual
create
-
Methods inherited from interface javax.enterprise.inject.spi.PassivationCapable
getId
-
Methods inherited from interface org.jboss.weld.bean.WeldBean
getPriority
-
-
-
-
Constructor Detail
-
AbstractBean
public AbstractBean(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 beforeProcessBeanAttributesis fired and also after the event if theBeanAttributeshave been altered.- Specified by:
preInitializein classRIBean<T>
-
internalInitialize
public void internalInitialize(BeanDeployerEnvironment environment)
Initializes the bean and its metadata- Specified by:
internalInitializein classRIBean<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)- Specified by:
initializeAfterBeanDiscoveryin 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 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 throwsIllegalStateExceptionat runtime.- Returns:
- The annotated item
- Throws:
IllegalStateException- when invoked at runtime
-
getSpecializedBeans
protected Set<? extends AbstractBean<?,?>> getSpecializedBeans()
-
isDependent
public boolean isDependent()
- Overrides:
isDependentin classRIBean<T>
-
isSpecializing
public boolean isSpecializing()
-
isProxyRequired
public boolean isProxyRequired()
- Specified by:
isProxyRequiredin classRIBean<T>
-
setProducer
public void setProducer(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()
-
-