org.jboss.weld.bean
Class ProducerMethod<X,T>

java.lang.Object
  extended by org.jboss.weld.bean.RIBean<T>
      extended by org.jboss.weld.bean.AbstractBean<T,S>
          extended by org.jboss.weld.bean.AbstractReceiverBean<X,T,S>
              extended by org.jboss.weld.bean.AbstractProducerBean<X,T,Method>
                  extended by org.jboss.weld.bean.ProducerMethod<X,T>
Type Parameters:
T -
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.PassivationCapable

public class ProducerMethod<X,T>
extends AbstractProducerBean<X,T,Method>

Represents a producer method bean

Author:
Pete Muir

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.weld.bean.AbstractProducerBean
AbstractProducerBean.AbstractProducer
 
Field Summary
 
Fields inherited from class org.jboss.weld.bean.AbstractBean
alternative, beanManager, name, qualifiers, scope, type, types
 
Fields inherited from class org.jboss.weld.bean.RIBean
BEAN_ID_PREFIX, BEAN_ID_SEPARATOR
 
Constructor Summary
protected ProducerMethod(WeldMethod<T,? super X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager, org.jboss.weld.bootstrap.api.ServiceRegistry services)
           
 
Method Summary
protected  void checkProducerMethod()
          Validates the producer method
protected  String createId(WeldMethod<T,? super X> method, AbstractClassBean<X> declaringBean)
           
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
           
protected  String getDefaultName()
          Returns the default name
 DisposalMethod<X,?> getDisposalMethod()
          Returns the disposal method
 String getId()
           
 AbstractBean<?,?> getSpecializedBean()
           
 WeldMethod<T,? super X> getWeldAnnotated()
          Gets the annotated item representing the method
 boolean hasDefaultProducer()
          Returns true if the bean uses the default Producer ( or InjectionTarget).
protected  void initDisposalMethod(BeanDeployerEnvironment environment)
          Initializes the remove method
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initProducerMethodInjectableParameters()
          Initializes the injection points
 boolean isProxyable()
           
static
<X,T> ProducerMethod<X,T>
of(WeldMethod<T,? super X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager, org.jboss.weld.bootstrap.api.ServiceRegistry services)
          Creates a producer method Web Bean
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 String toString()
           
 
Methods inherited from class org.jboss.weld.bean.AbstractProducerBean
checkProducerReturnType, checkReturnValue, checkType, create, getBeanClass, getInjectionPoints, getProducer, initScope, initType, initTypes, isPassivationCapableBean, isPassivationCapableDependency, isTypeSerializable, setProducer
 
Methods inherited from class org.jboss.weld.bean.AbstractReceiverBean
getDeclaringBean, getReceiver
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, cleanupAfterBoot, getDelegateInjectionPoints, getMergedStereotypes, getName, getNewInjectionPoints, getQualifiers, getScope, getServices, getStereotypes, getType, getTypedTypes, getTypes, getWeldInjectionPoints, initAlternative, initDefaultQualifiers, initializeAfterBeanDiscovery, initName, initQualifiers, initScopeFromStereotype, initStereotypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyRequired, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanManager, getQualifierInstances, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProducerMethod

protected ProducerMethod(WeldMethod<T,? super X> method,
                         AbstractClassBean<X> declaringBean,
                         BeanManagerImpl beanManager,
                         org.jboss.weld.bootstrap.api.ServiceRegistry services)
Method Detail

of

public static <X,T> ProducerMethod<X,T> of(WeldMethod<T,? super X> method,
                                           AbstractClassBean<X> declaringBean,
                                           BeanManagerImpl beanManager,
                                           org.jboss.weld.bootstrap.api.ServiceRegistry services)
Creates a producer method Web Bean

Parameters:
method - The underlying method abstraction
declaringBean - The declaring bean abstraction
beanManager - the current manager
Returns:
A producer Web Bean

createId

protected String createId(WeldMethod<T,? super X> method,
                          AbstractClassBean<X> declaringBean)

initialize

public void initialize(BeanDeployerEnvironment environment)
Initializes the bean and its metadata

Overrides:
initialize in class AbstractProducerBean<X,T,Method>

initProducerMethodInjectableParameters

protected void initProducerMethodInjectableParameters()
Initializes the injection points


checkProducerMethod

protected void checkProducerMethod()
Validates the producer method


initDisposalMethod

protected void initDisposalMethod(BeanDeployerEnvironment environment)
Initializes the remove method


destroy

public void destroy(T instance,
                    javax.enterprise.context.spi.CreationalContext<T> creationalContext)

getWeldAnnotated

public WeldMethod<T,? super X> getWeldAnnotated()
Gets the annotated item representing the method

Specified by:
getWeldAnnotated in class AbstractProducerBean<X,T,Method>
Returns:
The annotated item

getDefaultName

protected String getDefaultName()
Returns the default name

Specified by:
getDefaultName in class AbstractBean<T,Method>
Returns:
The default name

getDisposalMethod

public DisposalMethod<X,?> getDisposalMethod()
Returns the disposal method

Returns:
The method representation

getSpecializedBean

public AbstractBean<?,?> getSpecializedBean()
Specified by:
getSpecializedBean in class AbstractBean<T,Method>

preSpecialize

protected void preSpecialize(BeanDeployerEnvironment environment)
Overrides:
preSpecialize in class AbstractBean<T,Method>

specialize

protected void specialize(BeanDeployerEnvironment environment)
Overrides:
specialize in class AbstractBean<T,Method>

getId

public String getId()
Specified by:
getId in interface javax.enterprise.inject.spi.PassivationCapable
Overrides:
getId in class RIBean<T>

toString

public String toString()
Overrides:
toString in class RIBean<T>

isProxyable

public boolean isProxyable()
Specified by:
isProxyable in class RIBean<T>

hasDefaultProducer

public boolean hasDefaultProducer()
Description copied from class: AbstractBean
Returns true if the bean uses the default Producer ( or InjectionTarget). The method returns false if the producer of the bean was replaced by an extension.

Specified by:
hasDefaultProducer in class AbstractBean<T,Method>


Copyright © 2013 Seam Framework. All Rights Reserved.