org.jboss.webbeans.bean
Class AbstractProducerBean<T,S>

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,S>
Type Parameters:
T -
S -
All Implemented Interfaces:
Contextual<T>
Direct Known Subclasses:
ProducerFieldBean, ProducerMethodBean

public abstract class AbstractProducerBean<T,S>
extends AbstractBean<T,S>

The implicit producer bean

Author:
Gavin King

Field Summary
protected  AbstractClassBean<?> declaringBean
           
 
Fields inherited from class org.jboss.webbeans.bean.AbstractBean
_serializable, dependentInstancesStore, deploymentType, injectionPoints, manager, name, scopeType, type, types
 
Constructor Summary
AbstractProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager)
          Constructor
 
Method Summary
protected  void checkProducerReturnType()
          Validates the producer method
protected  void checkReturnValue(T instance)
          Validates the return value
 T create(CreationalContext<T> creationalContext)
          Creates an instance of the bean
 void destroy(T instance)
           
 boolean equals(java.lang.Object other)
           
protected  java.lang.reflect.Type getDeclaredBeanType()
          Gets the declared bean type
 AbstractClassBean<?> getDeclaringBean()
          Returns the declaring bean
protected  java.lang.Class<? extends java.lang.annotation.Annotation> getDefaultDeploymentType()
          Gets the deployment types
protected  java.lang.Object getReceiver(CreationalContext<?> creationalContext)
          Gets the receiver of the product
protected  void init()
          Initializes the bean and its metadata
protected  void initDeploymentType()
          Initializes the deployment types
protected  void initScopeType()
          Initializes the scope type
protected  void initSerializable()
           
protected  void initType()
          Initializes the type
protected  void initTypes()
          Initializes the API types
protected abstract  T produceInstance(CreationalContext<T> creationalContext)
           
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class org.jboss.webbeans.bean.AbstractBean
bindDecorators, bindInterceptors, checkDeploymentType, checkInjectionPointsAreSerializable, checkRequiredTypesImplemented, getAnnotatedItem, getBindings, getDefaultName, getDependentInstancesStore, getDeploymentType, getDeploymentType, getInjectionPoints, getMergedStereotypes, getName, getScopeType, getSpecializedBean, getType, getTypes, hashCode, initBindingTypes, initDefaultBindings, initDeploymentTypeFromStereotype, initName, initPrimitive, initProxyable, initScopeTypeFromStereotype, initSpecialization, isAssignableFrom, isDependent, isNullable, isPrimitive, isProxyable, isSerializable, isSpecializing, postSpecialization, preCheckSpecialization
 
Methods inherited from class org.jboss.webbeans.bean.RIBean
getManager
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

declaringBean

protected AbstractClassBean<?> declaringBean
Constructor Detail

AbstractProducerBean

public AbstractProducerBean(AbstractClassBean<?> declaringBean,
                            ManagerImpl manager)
Constructor

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

getDefaultDeploymentType

protected java.lang.Class<? extends java.lang.annotation.Annotation> getDefaultDeploymentType()
Gets the deployment types

Specified by:
getDefaultDeploymentType in class AbstractBean<T,S>
Returns:
The deployment types of the declaring bean

initTypes

protected void initTypes()
Initializes the API types

Overrides:
initTypes in class AbstractBean<T,S>

initType

protected void initType()
Initializes the type

Specified by:
initType in class AbstractBean<T,S>

getDeclaredBeanType

protected java.lang.reflect.Type getDeclaredBeanType()
Gets the declared bean type

Returns:
The bean type

getDeclaringBean

public AbstractClassBean<?> getDeclaringBean()
Returns the declaring bean

Returns:
The bean representation

checkProducerReturnType

protected void checkProducerReturnType()
Validates the producer method


init

protected void init()
Initializes the bean and its metadata

Overrides:
init in class AbstractBean<T,S>

checkReturnValue

protected void checkReturnValue(T instance)
Validates the return value

Parameters:
instance - The instance to validate

initScopeType

protected void initScopeType()
Description copied from class: AbstractBean
Initializes the scope type

Specified by:
initScopeType in class AbstractBean<T,S>

initDeploymentType

protected void initDeploymentType()
Description copied from class: AbstractBean
Initializes the deployment types

Specified by:
initDeploymentType in class AbstractBean<T,S>

initSerializable

protected void initSerializable()
Overrides:
initSerializable in class AbstractBean<T,S>

getReceiver

protected java.lang.Object getReceiver(CreationalContext<?> creationalContext)
Gets the receiver of the product

Returns:
The receiver

create

public T create(CreationalContext<T> creationalContext)
Creates an instance of the bean


destroy

public void destroy(T instance)

produceInstance

protected abstract T produceInstance(CreationalContext<T> creationalContext)

toString

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

Overrides:
toString in class AbstractBean<T,S>
Returns:
The string representation

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class AbstractBean<T,S>


Copyright © 2008-2009. All Rights Reserved.