org.apache.webbeans.component
Class ProducerMethodBean<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>
              extended by org.apache.webbeans.component.ProducerMethodBean<T>
All Implemented Interfaces:
Contextual<T>, Bean<T>, PassivationCapable, OwbBean<T>, BeanAttributes<T>

public class ProducerMethodBean<T>
extends AbstractProducerBean<T>

Concrete implementation of the AbstractOwbBean.

It is defined as producer method component.

Version:
$Rev: 1503028 $ $Date: 2013-07-14 21:08:13 +0200 (Sun, 14 Jul 2013) $

Field Summary
protected  Method creatorMethod
          Creator method of the parent component
protected  Method disposalMethod
          Disposal method
 
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
enabled, logger, passivatingId, specializedBean, webBeansContext, webBeansType
 
Constructor Summary
ProducerMethodBean(InjectionTargetBean<P> ownerComponent, BeanAttributesImpl<T> beanAttributes, Class<T> returnType, MethodProducerFactory<P> producerFactory)
          Creates a new instance.
 
Method Summary
 T create(CreationalContext<T> creationalContext)
          
 Method getCreatorMethod()
          Gets the creator method.
 Method getDisposalMethod()
           
 String getId()
          get the unique Id of the bean.
 boolean isPassivationCapable()
          True if passivation capable false otherwise.
 void setCreatorMethod(Method creatorMethod)
          Sets the method.
 void setDisposalMethod(Method disposalMethod)
          Sets the disposal method.
 
Methods inherited from class org.apache.webbeans.component.AbstractProducerBean
checkNullInstance, checkScopeType, dispose, getProducer, getReturnType, isPassivationCapable
 
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
destroy, getBeanClass, getInjectionPoints, getLogger, getWebBeansContext, getWebBeansType, isAlternative, isDependent, isEnabled, 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.Bean
getName, getQualifiers, getScope, getStereotypes, getTypes, isNullable
 

Field Detail

creatorMethod

protected Method creatorMethod
Creator method of the parent component


disposalMethod

protected Method disposalMethod
Disposal method

Constructor Detail

ProducerMethodBean

public ProducerMethodBean(InjectionTargetBean<P> ownerComponent,
                          BeanAttributesImpl<T> beanAttributes,
                          Class<T> returnType,
                          MethodProducerFactory<P> producerFactory)
Creates a new instance.

Parameters:
ownerComponent - parent bean
returnType - producer method return type
Method Detail

getCreatorMethod

public Method getCreatorMethod()
Gets the creator method.

Returns:
producer method

getDisposalMethod

public Method getDisposalMethod()

setCreatorMethod

public void setCreatorMethod(Method creatorMethod)
Sets the method.

Parameters:
creatorMethod - producer method

setDisposalMethod

public void setDisposalMethod(Method disposalMethod)
Sets the disposal method.

Parameters:
disposalMethod - disposal method of this producer method component

getId

public String getId()
Description copied from class: AbstractOwbBean
get the unique Id of the bean. This will get used as reference on passivation. Gets id of the bean.

Specified by:
getId in interface PassivationCapable
Specified by:
getId in interface OwbBean<T>
Overrides:
getId in class AbstractOwbBean<T>
Returns:
id of the bean

create

public T create(CreationalContext<T> creationalContext)
Description copied from class: AbstractOwbBean

Specified by:
create in interface Contextual<T>
Overrides:
create in class AbstractOwbBean<T>

isPassivationCapable

public boolean isPassivationCapable()
Description copied from interface: OwbBean
True if passivation capable false otherwise.

Specified by:
isPassivationCapable in interface OwbBean<T>
Overrides:
isPassivationCapable in class AbstractOwbBean<T>
Returns:
true if this bean is passivation capable


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