org.jboss.webbeans.bean
Class ProducerMethodBean<T>

java.lang.Object
  extended by javax.inject.manager.Bean<T>
      extended by org.jboss.webbeans.bean.RIBean<T>
          extended by org.jboss.webbeans.bean.AbstractBean<T,S>
              extended by org.jboss.webbeans.bean.AbstractProducerBean<T,java.lang.reflect.Method>
                  extended by org.jboss.webbeans.bean.ProducerMethodBean<T>
Type Parameters:
T -
All Implemented Interfaces:
Contextual<T>

public class ProducerMethodBean<T>
extends AbstractProducerBean<T,java.lang.reflect.Method>

Represents a producer method bean

Author:
Pete Muir

Field Summary
 
Fields inherited from class org.jboss.webbeans.bean.AbstractProducerBean
declaringBean
 
Fields inherited from class org.jboss.webbeans.bean.AbstractBean
_serializable, bindings, dependentInstancesStore, deploymentType, injectionPoints, manager, name, scopeType, type, types
 
Constructor Summary
protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
           
 
Method Summary
protected  void checkProducerMethod()
          Validates the producer method
 void destroy(T instance)
          Destroys an instance of the contexual type
 AnnotatedMethod<T> getAnnotatedItem()
          Gets the annotated item representing the method
protected  java.lang.String getDefaultName()
          Returns the default name
 DisposalMethodBean<?> getDisposalMethod()
          Returns the disposal method
 java.lang.String getId()
           
 AbstractBean<?,?> getSpecializedBean()
           
protected  void initDisposalMethod(BeanDeployerEnvironment environment)
          Initializes the remove method
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initInjectionPoints()
          Initializes the injection points
static
<T> ProducerMethodBean<T>
of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
          Creates a producer method Web Bean
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
protected  T produceInstance(CreationalContext<T> creationalContext)
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class org.jboss.webbeans.bean.AbstractProducerBean
checkProducerReturnType, checkReturnValue, create, getDeclaredBeanType, getDeclaringBean, getDefaultDeploymentType, getReceiver, initDeploymentType, initScopeType, initSerializable, initType, initTypes
 
Methods inherited from class org.jboss.webbeans.bean.AbstractBean
checkDeploymentType, checkRequiredTypesImplemented, getBindings, getDeploymentType, getDeploymentType, getInjectionPoints, getMergedStereotypes, getName, getScopeType, getType, getTypes, initBindings, initDefaultBindings, initDeploymentTypeFromStereotype, initName, initPrimitive, initProxyable, initScopeTypeFromStereotype, isAssignableFrom, isDependent, isInitialized, isNullable, isPrimitive, isProxyable, isSerializable, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.webbeans.bean.RIBean
createId, equals, getManager, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProducerMethodBean

protected ProducerMethodBean(AnnotatedMethod<T> method,
                             AbstractClassBean<?> declaringBean,
                             ManagerImpl manager)
Method Detail

of

public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method,
                                           AbstractClassBean<?> declaringBean,
                                           ManagerImpl 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

produceInstance

protected T produceInstance(CreationalContext<T> creationalContext)
Specified by:
produceInstance in class AbstractProducerBean<T,java.lang.reflect.Method>

initialize

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

Overrides:
initialize in class AbstractProducerBean<T,java.lang.reflect.Method>

initInjectionPoints

protected void initInjectionPoints()
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)
Description copied from interface: Contextual
Destroys an instance of the contexual type

Specified by:
destroy in interface Contextual<T>
Overrides:
destroy in class AbstractProducerBean<T,java.lang.reflect.Method>
Parameters:
instance - the insance to destroy

getAnnotatedItem

public AnnotatedMethod<T> getAnnotatedItem()
Gets the annotated item representing the method

Specified by:
getAnnotatedItem in class AbstractProducerBean<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 DisposalMethodBean<?> getDisposalMethod()
Returns the disposal method

Returns:
The method representation

toString

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

Overrides:
toString in class AbstractProducerBean<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 class RIBean<T>


Copyright © 2011. All Rights Reserved.