org.jboss.weld.bean
Class AbstractProducerBean<X,T,S extends java.lang.reflect.Member>

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,S>
Type Parameters:
T -
S -
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.PassivationCapable
Direct Known Subclasses:
ProducerField, ProducerMethod

public abstract class AbstractProducerBean<X,T,S extends java.lang.reflect.Member>
extends AbstractReceiverBean<X,T,S>

The implicit producer bean

Author:
Gavin King

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
AbstractProducerBean(java.lang.String idSuffix, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
          Constructor
 
Method Summary
protected  void checkProducerReturnType()
          Validates the producer method
protected  void checkReturnValue(T instance)
          Validates the return value
 T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Creates an instance of the bean
abstract  WeldMember<T,X,S> getAnnotatedItem()
          Returns the annotated time the bean represents
 java.lang.Class<?> getBeanClass()
           
 java.lang.String getDescription()
          Gets a string representation
 java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 javax.enterprise.inject.spi.Producer<T> getProducer()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initScopeType()
          Initializes the scope type
protected  void initSerializable()
           
protected  void initType()
          Initializes the type
protected  void initTypes()
          Initializes the API types
 boolean isSerializable()
           
 void setProducer(javax.enterprise.inject.spi.Producer<T> producer)
          This operation is *not* threadsafe, and should not be called outside bootstrap
 
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, getDefaultName, getDelegateInjectionPoints, getMergedStereotypes, getName, getQualifiers, getScope, getSpecializedBean, getStereotypes, getType, getTypes, initBindings, initDefaultBindings, initName, initPrimitive, initProxyable, initScopeTypeFromStereotype, initStereotypes, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSpecializing, postSpecialize, preSpecialize, specialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getId, getManager, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.enterprise.context.spi.Contextual
destroy
 

Constructor Detail

AbstractProducerBean

public AbstractProducerBean(java.lang.String idSuffix,
                            AbstractClassBean<X> declaringBean,
                            BeanManagerImpl manager)
Constructor

Parameters:
declaringBean - The declaring bean
manager - The Bean manager
Method Detail

getAnnotatedItem

public abstract WeldMember<T,X,S> getAnnotatedItem()
Description copied from class: AbstractBean
Returns the annotated time the bean represents

Specified by:
getAnnotatedItem in class AbstractReceiverBean<X,T,S extends java.lang.reflect.Member>
Returns:
The annotated item

getBeanClass

public java.lang.Class<?> getBeanClass()
Specified by:
getBeanClass in interface javax.enterprise.inject.spi.Bean<T>
Overrides:
getBeanClass in class RIBean<T>

initTypes

protected void initTypes()
Initializes the API types

Overrides:
initTypes in class AbstractBean<T,S extends java.lang.reflect.Member>

initType

protected void initType()
Initializes the type


checkProducerReturnType

protected void checkProducerReturnType()
Validates the producer method


initialize

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

Overrides:
initialize in class AbstractReceiverBean<X,T,S extends java.lang.reflect.Member>

getInjectionPoints

public java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
Specified by:
getInjectionPoints in interface javax.enterprise.inject.spi.Bean<T>
Overrides:
getInjectionPoints in class RIBean<T>

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 extends java.lang.reflect.Member>

initSerializable

protected void initSerializable()
Overrides:
initSerializable in class AbstractBean<T,S extends java.lang.reflect.Member>

isSerializable

public boolean isSerializable()
Overrides:
isSerializable in class AbstractBean<T,S extends java.lang.reflect.Member>

setProducer

public void setProducer(javax.enterprise.inject.spi.Producer<T> producer)
This operation is *not* threadsafe, and should not be called outside bootstrap

Parameters:
producer -

getProducer

public javax.enterprise.inject.spi.Producer<T> getProducer()

create

public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates an instance of the bean


getDescription

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

Specified by:
getDescription in class RIBean<T>
Returns:
The string representation


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