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:
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 the AbstractOwbBean.

It is defined as producer method component.

Version:
$Rev: 1622749 $ $Date: 2014-09-05 19:54:52 +0200 (Fri, 05 Sep 2014) $

Field Summary
protected  Method creatorMethod
          Creator method of the parent component
 
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
enabled, isAlternative, logger, passivatingId, specializedBean, webBeansContext, webBeansType
 
Constructor Summary
ProducerMethodBean(InjectionTargetBean<P> ownerComponent, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<T> returnType, MethodProducerFactory<P> producerFactory)
          Creates a new instance.
 
Method Summary
 T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          
 Method getCreatorMethod()
          Gets the creator method.
 String getId()
          get the unique Id of the bean.
 boolean isPassivationCapable()
          True if passivation capable false otherwise.
 void setCreatorMethod(Method creatorMethod)
          Sets the 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, equals, getBeanClass, getInjectionPoints, getLogger, getWebBeansContext, getWebBeansType, hashCode, isAlternative, isDependent, isEnabled, isSpecializedBean, providedId, 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, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.enterprise.inject.spi.Bean
isNullable
 
Methods inherited from interface javax.enterprise.inject.spi.BeanAttributes
getName, getQualifiers, getScope, getStereotypes, getTypes
 

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 bean
returnType - 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: 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 javax.enterprise.inject.spi.PassivationCapable
Specified by:
getId in interface OwbBean<T>
Overrides:
getId in class AbstractOwbBean<T>
Returns:
id of the bean

create

public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Description copied from class: AbstractOwbBean

Specified by:
create in interface javax.enterprise.context.spi.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–2015 The Apache Software Foundation. All rights reserved.