org.jboss.weld.bean
Class AbstractProducerBean<X,T,S extends 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:
X -
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 Member>
extends AbstractReceiverBean<X,T,S>

The implicit producer bean

Author:
Gavin King, David Allen, Marko Luksa

Nested Class Summary
protected  class AbstractProducerBean.AbstractProducer
           
 
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
AbstractProducerBean(String idSuffix, AbstractClassBean<X> declaringBean, BeanManagerImpl beanManager, org.jboss.weld.bootstrap.api.ServiceRegistry services)
          Constructor
 
Method Summary
protected  void checkProducerReturnType()
          Validates the producer method
protected  void checkReturnValue(T instance)
          Validates the return value
protected  void checkType()
           
 T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Creates an instance of the bean
 Class<?> getBeanClass()
           
 Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 javax.enterprise.inject.spi.Producer<T> getProducer()
           
abstract  WeldMember<T,? super X,S> getWeldAnnotated()
          Returns the annotated item the bean represents
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initScope()
           
protected  void initType()
          Initializes the type
protected  void initTypes()
          Initializes the API types
 boolean isPassivationCapableBean()
           
 boolean isPassivationCapableDependency()
           
protected  boolean isTypeSerializable(Class<?> clazz)
           
 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
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, cleanupAfterBoot, getDefaultName, getDelegateInjectionPoints, getMergedStereotypes, getName, getNewInjectionPoints, getQualifiers, getScope, getServices, getSpecializedBean, getStereotypes, getType, getTypedTypes, getTypes, getWeldInjectionPoints, hasDefaultProducer, initAlternative, initDefaultQualifiers, initializeAfterBeanDiscovery, initName, initQualifiers, initScopeFromStereotype, initStereotypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyRequired, isSpecializing, postSpecialize, preSpecialize, specialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanManager, getId, getQualifierInstances, hashCode, isProxyable, 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(String idSuffix,
                            AbstractClassBean<X> declaringBean,
                            BeanManagerImpl beanManager,
                            org.jboss.weld.bootstrap.api.ServiceRegistry services)
Constructor

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

getWeldAnnotated

public abstract WeldMember<T,? super X,S> getWeldAnnotated()
Description copied from class: AbstractBean
Returns the annotated item the bean represents

Specified by:
getWeldAnnotated in class AbstractReceiverBean<X,T,S extends Member>
Returns:
The annotated item

getBeanClass

public 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 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 Member>

isPassivationCapableBean

public boolean isPassivationCapableBean()
Specified by:
isPassivationCapableBean in class RIBean<T>

isPassivationCapableDependency

public boolean isPassivationCapableDependency()
Specified by:
isPassivationCapableDependency in class RIBean<T>

getInjectionPoints

public 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

checkType

protected void checkType()
Specified by:
checkType in class AbstractBean<T,S extends Member>

isTypeSerializable

protected boolean isTypeSerializable(Class<?> clazz)

initScope

protected void initScope()
Specified by:
initScope in class AbstractBean<T,S extends 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



Copyright © 2013 Seam Framework. All Rights Reserved.