Package org.apache.webbeans.component
Class AbstractProducerBean<T>
- java.lang.Object
-
- org.apache.webbeans.component.BeanAttributesImpl<T>
-
- org.apache.webbeans.component.AbstractOwbBean<T>
-
- org.apache.webbeans.component.AbstractProducerBean<T>
-
- Type Parameters:
T- bean type info
- 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>
- Direct Known Subclasses:
ProducerFieldBean,ProducerMethodBean
public class AbstractProducerBean<T> extends AbstractOwbBean<T>
Abstract class for producer components.- Version:
- $Rev$ $Date$
-
-
Field Summary
-
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
enabled, logger, passivatingId, specializedBean, webBeansContext, webBeansType
-
-
Constructor Summary
Constructors Constructor Description AbstractProducerBean(InjectionTargetBean<?> ownerComponent, WebBeansType webBeansType, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<T> returnType, javax.enterprise.inject.spi.ProducerFactory<?> producerFactory)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckNullInstance(Object instance, String producerName)Check null control.protected voidcheckScopeType(String producerName, Object instance)Check passivation check.InjectionTargetBean<?>getOwnerComponent()javax.enterprise.inject.spi.Producer<T>getProducer()Class<T>getReturnType()Gets type of the producer method/field or the bean class if it's not a producer.protected booleanisPassivationCapable(Class<?> returnType, Integer modifiers)protected StringprovidedId()-
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
addToStringInfo, create, destroy, equals, getBeanClass, getId, getInjectionPoints, getLogger, getWebBeansContext, getWebBeansType, hashCode, isDependent, isEnabled, isPassivationCapable, isSpecializedBean, setEnabled, setSpecializedBean, toString
-
Methods inherited from class org.apache.webbeans.component.BeanAttributesImpl
getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative, isNullable
-
-
-
-
Constructor Detail
-
AbstractProducerBean
public AbstractProducerBean(InjectionTargetBean<?> ownerComponent, WebBeansType webBeansType, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<T> returnType, javax.enterprise.inject.spi.ProducerFactory<?> producerFactory)
Create a new instance.- Parameters:
returnType- bean type info
-
-
Method Detail
-
getProducer
public javax.enterprise.inject.spi.Producer<T> getProducer()
- Returns:
- the producer for this bean;
-
getReturnType
public Class<T> getReturnType()
Description copied from class:AbstractOwbBeanGets 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>- Overrides:
getReturnTypein classAbstractOwbBean<T>- Returns:
- type of the producer method
- See Also:
AbstractOwbBean.getBeanClass()
-
getOwnerComponent
public InjectionTargetBean<?> getOwnerComponent()
-
providedId
protected String providedId()
- Overrides:
providedIdin classAbstractOwbBean<T>
-
checkNullInstance
protected void checkNullInstance(Object instance, String producerName)
Check null control.- Parameters:
instance- bean instance
-
checkScopeType
protected void checkScopeType(String producerName, Object instance)
Check passivation check.
-
-