Package org.apache.webbeans.component
Class ProducerMethodBean<T>
- java.lang.Object
-
- org.apache.webbeans.component.BeanAttributesImpl<T>
-
- org.apache.webbeans.component.AbstractOwbBean<T>
-
- org.apache.webbeans.component.AbstractProducerBean<T>
-
- org.apache.webbeans.component.ProducerMethodBean<T>
-
- All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>,javax.enterprise.inject.spi.Bean<T>,javax.enterprise.inject.spi.BeanAttributes<T>,javax.enterprise.inject.spi.PassivationCapable,OwbBean<T>
public class ProducerMethodBean<T> extends AbstractProducerBean<T>
Concrete implementation of theAbstractOwbBean.It is defined as producer method component.
- Version:
- $Rev$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description protected MethodcreatorMethodCreator method of the parent component-
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
enabled, logger, passivatingId, specializedBean, webBeansContext, webBeansType
-
-
Constructor Summary
Constructors Constructor Description ProducerMethodBean(InjectionTargetBean<P> ownerComponent, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<T> returnType, MethodProducerFactory<P> producerFactory)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToStringInfo(StringBuilder builder)For producer beans we add the info about the owner componentTcreate(javax.enterprise.context.spi.CreationalContext<T> creationalContext)MethodgetCreatorMethod()Gets the creator method.StringgetId()get the unique Id of the bean.booleanisPassivationCapable()True if passivation capable false otherwise.voidsetCreatorMethod(Method creatorMethod)Sets the method.-
Methods inherited from class org.apache.webbeans.component.AbstractProducerBean
checkNullInstance, checkScopeType, getOwnerComponent, getProducer, getReturnType, isPassivationCapable, providedId
-
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
destroy, equals, getBeanClass, getInjectionPoints, getLogger, getWebBeansContext, getWebBeansType, hashCode, isDependent, isEnabled, isSpecializedBean, setEnabled, setSpecializedBean, toString
-
Methods inherited from class org.apache.webbeans.component.BeanAttributesImpl
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative, isNullable
-
-
-
-
Field Detail
-
creatorMethod
protected Method creatorMethod
Creator method of the parent component
-
-
Constructor Detail
-
ProducerMethodBean
public ProducerMethodBean(InjectionTargetBean<P> ownerComponent, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<T> returnType, MethodProducerFactory<P> producerFactory)
Creates a new instance.- Parameters:
ownerComponent- parent beanreturnType- producer method return type
-
-
Method Detail
-
getCreatorMethod
public Method getCreatorMethod()
Gets the creator method.- Returns:
- producer method
-
setCreatorMethod
public void setCreatorMethod(Method creatorMethod)
Sets the method.- Parameters:
creatorMethod- producer method
-
getId
public String getId()
Description copied from class:AbstractOwbBeanget the unique Id of the bean. This will get used as reference on passivation. Gets id of the bean.
-
create
public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Description copied from class:AbstractOwbBean- Specified by:
createin interfacejavax.enterprise.context.spi.Contextual<T>- Overrides:
createin classAbstractOwbBean<T>
-
isPassivationCapable
public boolean isPassivationCapable()
Description copied from interface:OwbBeanTrue if passivation capable false otherwise.- Specified by:
isPassivationCapablein interfaceOwbBean<T>- Overrides:
isPassivationCapablein classAbstractOwbBean<T>- Returns:
- true if this bean is passivation capable
-
addToStringInfo
protected void addToStringInfo(StringBuilder builder)
For producer beans we add the info about the owner component- Overrides:
addToStringInfoin classAbstractOwbBean<T>
-
-