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
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)
           
 
Method Summary
protected  void checkProducerMethod()
          Validates the producer method
protected  java.lang.String createId(WeldMethod<T,? super X> method, AbstractClassBean<X> declaringBean)
           
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
           
protected  java.lang.String getDefaultName()
          Returns the default name
 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()
           
 WeldMethod<T,? super X> getWeldAnnotated()
          Gets the annotated item representing the method
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,? super X> method, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager)
          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, initScope, initType, initTypes, isPassivationCapableBean, isPassivationCapableDependency, isTypeSerializable, setProducer
 
Methods inherited from class org.jboss.weld.bean.AbstractReceiverBean
getDeclaringBean, getReceiver, initAlternative
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, getDelegateInjectionPoints, getMergedStereotypes, getName, getNewInjectionPoints, getQualifiers, getScope, getType, getTypedTypes, getTypes, getWeldInjectionPoints, initDefaultQualifiers, initName, initQualifiers, initScopeFromStereotype, initStereotypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
checkType, equals, getBeanManager, hashCode, initializeAfterBeanDiscovery, isProxyRequired, toString
 
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)
Method Detail

of

public static <X,T> ProducerMethod<X,T> of(WeldMethod<T,? super X> method,
                                           AbstractClassBean<X> declaringBean,
                                           BeanManagerImpl beanManager)
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 java.lang.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,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)

getWeldAnnotated

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

Specified by:
getWeldAnnotated 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

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-2010 Seam Framework. All Rights Reserved.