org.apache.webbeans.component
Class AbstractProducerBean<T>

java.lang.Object
  extended by org.apache.webbeans.component.BeanAttributesImpl<T>
      extended by org.apache.webbeans.component.AbstractOwbBean<T>
          extended by org.apache.webbeans.component.AbstractProducerBean<T>
Type Parameters:
T - bean type info
All Implemented Interfaces:
Contextual<T>, Bean<T>, PassivationCapable, OwbBean<T>, BeanAttributes<T>
Direct Known Subclasses:
ProducerFieldBean, ProducerMethodBean

public class AbstractProducerBean<T>
extends AbstractOwbBean<T>
implements PassivationCapable

Abstract class for producer components.

Version:
$Rev: 1523424 $ $Date: 2013-09-15 11:53:43 +0200 (Sun, 15 Sep 2013) $

Field Summary
 
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
enabled, logger, passivatingId, specializedBean, webBeansContext, webBeansType
 
Constructor Summary
AbstractProducerBean(Class<?> ownerBeanClass, WebBeansContext webBeansContext, WebBeansType webBeansType, BeanAttributes<T> beanAttributes, Class<T> returnType, ProducerFactory<?> producerFactory)
          Create a new instance.
 
Method Summary
protected  void checkNullInstance(Object instance, String producerName)
          Check null control.
protected  void checkScopeType(String producerName)
          Check passivation check.
 void dispose(T instance, CreationalContext<T> creationalContext)
          
 Producer<T> getProducer()
           
 Class<T> getReturnType()
          Gets type of the producer method/field or the bean class if it's not a producer.
protected  boolean isPassivationCapable(Class<?> returnType, Integer modifiers)
           
 
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
create, destroy, getBeanClass, getId, getInjectionPoints, getLogger, getWebBeansContext, getWebBeansType, isAlternative, isDependent, isEnabled, isPassivationCapable, isSpecializedBean, setEnabled, setSpecializedBean, toString
 
Methods inherited from class org.apache.webbeans.component.BeanAttributesImpl
getName, getQualifiers, getScope, getStereotypes, getTypes, isNullable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.enterprise.inject.spi.PassivationCapable
getId
 
Methods inherited from interface javax.enterprise.inject.spi.Bean
getName, getQualifiers, getScope, getStereotypes, getTypes, isNullable
 

Constructor Detail

AbstractProducerBean

public AbstractProducerBean(Class<?> ownerBeanClass,
                            WebBeansContext webBeansContext,
                            WebBeansType webBeansType,
                            BeanAttributes<T> beanAttributes,
                            Class<T> returnType,
                            ProducerFactory<?> producerFactory)
Create a new instance.

Parameters:
returnType - bean type info
ownerBeanClass - class which contains this producer method or field
Method Detail

getProducer

public Producer<T> getProducer()
Specified by:
getProducer in interface OwbBean<T>
Returns:
the producer for this bean;

getReturnType

public Class<T> getReturnType()
Description copied from class: AbstractOwbBean
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:
getReturnType in interface OwbBean<T>
Overrides:
getReturnType in class AbstractOwbBean<T>
Returns:
type of the producer method
See Also:
AbstractOwbBean.getBeanClass()

dispose

public void dispose(T instance,
                    CreationalContext<T> creationalContext)


checkNullInstance

protected void checkNullInstance(Object instance,
                                 String producerName)
Check null control.

Parameters:
instance - bean instance

checkScopeType

protected void checkScopeType(String producerName)
Check passivation check.


isPassivationCapable

protected boolean isPassivationCapable(Class<?> returnType,
                                       Integer modifiers)


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.