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,java.lang.reflect.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,java.lang.reflect.Method>

Represents a producer method bean

Author:
Pete Muir

Field Summary
 
Fields inherited from class org.jboss.weld.bean.AbstractBean
bindings, manager, name, scopeType, type, types
 
Fields inherited from class org.jboss.weld.bean.RIBean
BEAN_ID_PREFIX, BEAN_ID_SEPARATOR
 
Constructor Summary
protected ProducerMethod(WeldMethod<T,X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
           
 
Method Summary
protected  void checkProducerMethod()
          Validates the producer method
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
           
 WeldMethod<T,X> getAnnotatedItem()
          Gets the annotated item representing the method
protected  java.lang.String getDefaultName()
          Returns the default name
 java.lang.String getDescription()
          Gets a string representation
 DisposalMethod<X,?> getDisposalMethod()
          Returns the disposal method
 java.lang.String getId()
           
 AbstractBean<?,?> getSpecializedBean()
           
 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
           
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
static
<X,T> ProducerMethod<X,T>
of(WeldMethod<T,X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
          Creates a producer method Web Bean
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 
Methods inherited from class org.jboss.weld.bean.AbstractProducerBean
checkProducerReturnType, checkReturnValue, create, getBeanClass, getInjectionPoints, getProducer, initScopeType, initSerializable, initType, initTypes, isSerializable, setProducer
 
Methods inherited from class org.jboss.weld.bean.AbstractReceiverBean
getDeclaringBean, getReceiver, initPolicy, isAlternative
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, getAnnotatedInjectionPoints, getDelegateInjectionPoints, getMergedStereotypes, getName, getQualifiers, getScope, getType, getTypes, initBindings, initDefaultBindings, initName, initPrimitive, initProxyable, initScopeTypeFromStereotype, initStereotypes, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getManager, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProducerMethod

protected ProducerMethod(WeldMethod<T,X> method,
                         AbstractClassBean<X> declaringBean,
                         BeanManagerImpl manager)
Method Detail

of

public static <X,T> ProducerMethod<X,T> of(WeldMethod<T,X> method,
                                           AbstractClassBean<X> declaringBean,
                                           BeanManagerImpl manager)
Creates a producer method Web Bean

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

initialize

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

Overrides:
initialize in class AbstractProducerBean<X,T,java.lang.reflect.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)

getAnnotatedItem

public WeldMethod<T,X> getAnnotatedItem()
Gets the annotated item representing the method

Specified by:
getAnnotatedItem in class AbstractProducerBean<X,T,java.lang.reflect.Method>
Returns:
The annotated item

getDefaultName

protected java.lang.String getDefaultName()
Returns the default name

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

getDisposalMethod

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

Returns:
The method representation

getDescription

public java.lang.String getDescription()
Gets a string representation

Overrides:
getDescription in class AbstractProducerBean<X,T,java.lang.reflect.Method>
Returns:
The string representation

getSpecializedBean

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

preSpecialize

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

specialize

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

getId

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

getStereotypes

public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
Specified by:
getStereotypes in interface javax.enterprise.inject.spi.Bean<T>
Overrides:
getStereotypes in class AbstractBean<T,java.lang.reflect.Method>


Copyright © 2008-2009 Seam Framework. All Rights Reserved.