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

java.lang.Object
  extended by javax.webbeans.manager.Bean<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
apiTypes, deploymentType, injectionPoints, manager, name, scopeType, type
 
Constructor Summary
ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
          Constructor
ProducerMethodBean(java.lang.reflect.Method method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
          Constructor
 
Method Summary
protected  void checkProducerMethod()
          Validates the producer method
 T create()
          Creates an instance of the bean
 void destroy(T instance)
           
protected  AnnotatedMethod<T> getAnnotatedItem()
          Gets the annotated item representing the method
protected  java.lang.String getDefaultName()
          Returns the default name
 AnnotatedMethod<?> getDisposalMethod()
          Returns the disposal method
protected  void init()
          Initializes the bean and its metadata
protected  void initDisposalMethod()
          Initializes the remove method
protected  void initInjectionPoints()
          Initializes the injection points
 java.lang.String toDetailedString()
           
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class org.jboss.webbeans.bean.AbstractProducerBean
checkProducerReturnType, checkReturnValue, getDeclaringBean, getDefaultDeploymentType, getReceiver, initApiTypes, initType
 
Methods inherited from class org.jboss.webbeans.bean.AbstractBean
bindDecorators, bindInterceptors, checkDeploymentType, getBindingTypes, getDeclaredBeanType, getDeploymentType, getDeploymentType, getInjectionPoints, getMergedStereotypes, getName, getScopeType, getSpecializedType, getType, getTypes, initBindingTypes, initDeploymentType, initName, initPrimitive, initScopeType, isAssignableFrom, isNullable, isPrimitive, isSerializable
 
Methods inherited from class javax.webbeans.manager.Bean
getManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProducerMethodBean

public ProducerMethodBean(java.lang.reflect.Method method,
                          AbstractClassBean<?> declaringBean,
                          ManagerImpl manager)
Constructor

Parameters:
method - The producer method
declaringBean - The declaring bean instance
manager - The Web Beans manager

ProducerMethodBean

public ProducerMethodBean(AnnotatedMethod<T> method,
                          AbstractClassBean<?> declaringBean,
                          ManagerImpl manager)
Constructor

Parameters:
method - The producer method abstraction
declaringBean - The declaring bean
manager - The Web Beans manager
Method Detail

create

public T create()
Creates an instance of the bean

Specified by:
create in interface Contextual<T>
Specified by:
create in class Bean<T>

destroy

public void destroy(T instance)
Specified by:
destroy in interface Contextual<T>
Specified by:
destroy in class Bean<T>

init

protected void init()
Initializes the bean and its metadata

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

initInjectionPoints

protected void initInjectionPoints()
Initializes the injection points

Overrides:
initInjectionPoints in class AbstractBean<T,java.lang.reflect.Method>

checkProducerMethod

protected void checkProducerMethod()
Validates the producer method


initDisposalMethod

protected void initDisposalMethod()
Initializes the remove method


getAnnotatedItem

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

Specified by:
getAnnotatedItem in class AbstractBean<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 AnnotatedMethod<?> 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

toDetailedString

public java.lang.String toDetailedString()
Overrides:
toDetailedString in class AbstractBean<T,java.lang.reflect.Method>


Copyright © 2008. All Rights Reserved.