Package org.apache.webbeans.component
Class AbstractOwbBean<T>
- java.lang.Object
-
- org.apache.webbeans.component.BeanAttributesImpl<T>
-
- org.apache.webbeans.component.AbstractOwbBean<T>
-
- 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,OwbBean<T>
- Direct Known Subclasses:
AbstractProducerBean,BuiltInOwbBean,InjectionTargetBean,ProducerAwareInjectionTargetBean,ThirdpartyBeanImpl
public abstract class AbstractOwbBean<T> extends BeanAttributesImpl<T> implements OwbBean<T>, jakarta.enterprise.inject.spi.PassivationCapable
Abstract implementation of theOwbBeancontract.- Version:
- $Rev$ $Date$
- See Also:
Bean
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanenabledThis bean is enabled or disabledprotected LoggerloggerLogger instanceprotected StringpassivatingIdThis string will be used for passivating the Bean.protected booleanspecializedBeanThis bean is specialized or notprotected WebBeansContextwebBeansContextprotected WebBeansTypewebBeansTypeWeb Beans type
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOwbBean(WebBeansContext webBeansContext, WebBeansType webBeansType, jakarta.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<?> beanClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToStringInfo(StringBuilder builder)This method can be used to add additional info about the BeanTcreate(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)voiddestroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)booleanequals(Object o)Class<?>getBeanClass()StringgetId()get the unique Id of the bean.Set<jakarta.enterprise.inject.spi.InjectionPoint>getInjectionPoints()protected LoggergetLogger()The Logger should really only be used to log errors!Class<T>getReturnType()Gets type of the producer method/field or the bean class if it's not a producer.WebBeansContextgetWebBeansContext()Get the web beans context this bean is associated withWebBeansTypegetWebBeansType()Get web bean type of the bean.inthashCode()booleanisDependent()This determines if this bean is really a dependent bean, and as such always creats a freshl instance for each InjectionPoint.booleanisEnabled()Bean is enabled or not.booleanisPassivationCapable()True if passivation capable false otherwise.booleanisSpecializedBean()Returns true if bean is a specialized bean, false otherwise.protected StringprovidedId()voidsetEnabled(boolean enabled)Set enableed flag.voidsetSpecializedBean(boolean specialized)Set specialized flag.StringtoString()-
Methods inherited from class org.apache.webbeans.component.BeanAttributesImpl
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.apache.webbeans.component.OwbBean
getProducer
-
-
-
-
Field Detail
-
logger
protected Logger logger
Logger instance
-
webBeansType
protected WebBeansType webBeansType
Web Beans type
-
specializedBean
protected boolean specializedBean
This bean is specialized or not
-
enabled
protected boolean enabled
This bean is enabled or disabled
-
passivatingId
protected String passivatingId
This string will be used for passivating the Bean. It will be created on the first use.- See Also:
getId()
-
webBeansContext
protected final WebBeansContext webBeansContext
-
-
Constructor Detail
-
AbstractOwbBean
protected AbstractOwbBean(WebBeansContext webBeansContext, WebBeansType webBeansType, jakarta.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<?> beanClass)
-
-
Method Detail
-
getWebBeansContext
public WebBeansContext getWebBeansContext()
Get the web beans context this bean is associated with- Specified by:
getWebBeansContextin interfaceOwbBean<T>- Returns:
- WebBeansContext this bean is associated with
-
getBeanClass
public Class<?> getBeanClass()
- Specified by:
getBeanClassin interfacejakarta.enterprise.inject.spi.Bean<T>
-
create
public T create(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
- Specified by:
createin interfacejakarta.enterprise.context.spi.Contextual<T>
-
destroy
public void destroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
- Specified by:
destroyin interfacejakarta.enterprise.context.spi.Contextual<T>
-
getId
public String getId()
get the unique Id of the bean. This will get used as reference on passivation. Gets id of the bean.
-
providedId
protected String providedId()
-
isPassivationCapable
public boolean isPassivationCapable()
Description copied from interface:OwbBeanTrue if passivation capable false otherwise.- Specified by:
isPassivationCapablein interfaceOwbBean<T>- Returns:
- true if this bean is passivation capable
-
getWebBeansType
public WebBeansType getWebBeansType()
Get web bean type of the bean.- Specified by:
getWebBeansTypein interfaceOwbBean<T>- Returns:
- web beans type
- See Also:
WebBeansType
-
getReturnType
public Class<T> getReturnType()
Gets type of the producer method/field or the bean class if it's not a producer. This basically determines the class which will get created.- Specified by:
getReturnTypein interfaceOwbBean<T>- Returns:
- type of the producer method
- See Also:
getBeanClass()
-
getInjectionPoints
public Set<jakarta.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
- Specified by:
getInjectionPointsin interfacejakarta.enterprise.inject.spi.Bean<T>
-
setSpecializedBean
public void setSpecializedBean(boolean specialized)
Set specialized flag.- Specified by:
setSpecializedBeanin interfaceOwbBean<T>- Parameters:
specialized- flag
-
setEnabled
public void setEnabled(boolean enabled)
Set enableed flag.- Specified by:
setEnabledin interfaceOwbBean<T>- Parameters:
enabled- flag
-
isSpecializedBean
public boolean isSpecializedBean()
Returns true if bean is a specialized bean, false otherwise.- Specified by:
isSpecializedBeanin interfaceOwbBean<T>- Returns:
- true if bean is a specialized bean
-
isEnabled
public boolean isEnabled()
Bean is enabled or not.
-
addToStringInfo
protected void addToStringInfo(StringBuilder builder)
This method can be used to add additional info about the Bean- Parameters:
builder-
-
getLogger
protected Logger getLogger()
The Logger should really only be used to log errors!
-
isDependent
public boolean isDependent()
Description copied from interface:OwbBeanThis determines if this bean is really a dependent bean, and as such always creats a freshl instance for each InjectionPoint. A BeanManagerBean is e.g. not a dependent bean.- Specified by:
isDependentin interfaceOwbBean<T>- Returns:
trueif this is a dependent bean
-
-