org.jboss.weld.bean
Class AbstractBean<T,S>

java.lang.Object
  extended by org.jboss.weld.bean.RIBean<T>
      extended by org.jboss.weld.bean.AbstractBean<T,S>
Type Parameters:
T - the type of bean
S - the Class of the bean type
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.PassivationCapable
Direct Known Subclasses:
AbstractClassBean, AbstractReceiverBean

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

An abstract bean representation common for all beans

Author:
Pete Muir, Ales Justin

Field Summary
protected  boolean alternative
           
protected  BeanManagerImpl beanManager
           
protected  String name
           
protected  Set<Annotation> qualifiers
           
protected  Class<? extends Annotation> scope
           
protected  Class<T> type
           
protected  Set<Type> types
           
 
Fields inherited from class org.jboss.weld.bean.RIBean
BEAN_ID_PREFIX, BEAN_ID_SEPARATOR
 
Constructor Summary
AbstractBean(String idSuffix, BeanManagerImpl beanManager, org.jboss.weld.bootstrap.api.ServiceRegistry services)
          Constructor
 
Method Summary
protected  void addInjectionPoint(WeldInjectionPoint<?,?> injectionPoint)
           
protected  void addInjectionPoints(Iterable<? extends WeldInjectionPoint<?,?>> injectionPoints)
           
protected  void checkDelegateInjectionPoints()
           
protected abstract  void checkType()
           
 void cleanupAfterBoot()
          This method is called after the container is started allowing the bean to release any resources that are only required at boot time
protected abstract  String getDefaultName()
          Gets the default name of the bean
protected  Set<WeldInjectionPoint<?,?>> getDelegateInjectionPoints()
           
protected  MergedStereotypes<T,S> getMergedStereotypes()
          Gets the merged stereotypes of the bean
 String getName()
          Gets the name of the bean
 Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()
           
 Set<Annotation> getQualifiers()
          Gets the binding types
 Class<? extends Annotation> getScope()
          Gets the scope type of the bean
protected  org.jboss.weld.bootstrap.api.ServiceRegistry getServices()
           
abstract  AbstractBean<?,?> getSpecializedBean()
           
 Set<Class<? extends Annotation>> getStereotypes()
           
 Class<T> getType()
          Gets the type of the bean
protected static Set<Type> getTypedTypes(Map<Class<?>,Type> typeClosure, Class<?> rawType, javax.enterprise.inject.Typed typed)
           
 Set<Type> getTypes()
          Gets the API types of the bean
abstract  WeldAnnotated<T,S> getWeldAnnotated()
          Returns the annotated item the bean represents
 Set<WeldInjectionPoint<?,?>> getWeldInjectionPoints()
           
abstract  boolean hasDefaultProducer()
          Returns true if the bean uses the default Producer ( or InjectionTarget).
protected  void initAlternative()
           
protected  void initDefaultQualifiers()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
 void initializeAfterBeanDiscovery()
          In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g.
protected  void initName()
          Initializes the name
protected  void initQualifiers()
           
protected abstract  void initScope()
           
protected  boolean initScopeFromStereotype()
           
protected  void initStereotypes()
           
protected  void initTypes()
           
 boolean isAlternative()
           
 boolean isDependent()
           
protected  boolean isInitialized()
           
 boolean isNormalScoped()
           
 boolean isNullable()
          Indicates if bean is nullable
 boolean isPrimitive()
          Indicates if bean type is a primitive
 boolean isProxyRequired()
           
 boolean isSpecializing()
           
protected  void postSpecialize()
           
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getBeanManager, getId, getInjectionPoints, getQualifierInstances, hashCode, isPassivationCapableBean, isPassivationCapableDependency, 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
create, destroy
 

Field Detail

qualifiers

protected Set<Annotation> qualifiers

name

protected String name

scope

protected Class<? extends Annotation> scope

alternative

protected boolean alternative

type

protected Class<T> type

types

protected Set<Type> types

beanManager

protected BeanManagerImpl beanManager
Constructor Detail

AbstractBean

public AbstractBean(String idSuffix,
                    BeanManagerImpl beanManager,
                    org.jboss.weld.bootstrap.api.ServiceRegistry services)
Constructor

Parameters:
beanManager - The Bean manager
Method Detail

cleanupAfterBoot

public void cleanupAfterBoot()
Description copied from class: RIBean
This method is called after the container is started allowing the bean to release any resources that are only required at boot time

Specified by:
cleanupAfterBoot in class RIBean<T>

initialize

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

Specified by:
initialize in class RIBean<T>

initStereotypes

protected void initStereotypes()

checkDelegateInjectionPoints

protected void checkDelegateInjectionPoints()

initializeAfterBeanDiscovery

public void initializeAfterBeanDiscovery()
Description copied from class: RIBean
In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g. for initializing decorators taking into account the possibility of having custom decorators which are deployed through portable extensions)

Specified by:
initializeAfterBeanDiscovery in class RIBean<T>

checkType

protected abstract void checkType()

addInjectionPoint

protected void addInjectionPoint(WeldInjectionPoint<?,?> injectionPoint)

addInjectionPoints

protected void addInjectionPoints(Iterable<? extends WeldInjectionPoint<?,?>> injectionPoints)

getDelegateInjectionPoints

protected Set<WeldInjectionPoint<?,?>> getDelegateInjectionPoints()

initTypes

protected void initTypes()

getTypedTypes

protected static Set<Type> getTypedTypes(Map<Class<?>,Type> typeClosure,
                                         Class<?> rawType,
                                         javax.enterprise.inject.Typed typed)

initQualifiers

protected void initQualifiers()

initDefaultQualifiers

protected void initDefaultQualifiers()

initAlternative

protected void initAlternative()

initName

protected void initName()
Initializes the name


initScope

protected abstract void initScope()

initScopeFromStereotype

protected boolean initScopeFromStereotype()

postSpecialize

protected void postSpecialize()

preSpecialize

protected void preSpecialize(BeanDeployerEnvironment environment)

specialize

protected void specialize(BeanDeployerEnvironment environment)

getWeldAnnotated

public abstract WeldAnnotated<T,S> getWeldAnnotated()
Returns the annotated item the bean represents

Returns:
The annotated item

getQualifiers

public Set<Annotation> getQualifiers()
Gets the binding types

Returns:
The set of binding types
See Also:
Bean.getQualifiers()

getDefaultName

protected abstract String getDefaultName()
Gets the default name of the bean

Returns:
The default name

getSpecializedBean

public abstract AbstractBean<?,?> getSpecializedBean()
Specified by:
getSpecializedBean in class RIBean<T>

getWeldInjectionPoints

public Set<WeldInjectionPoint<?,?>> getWeldInjectionPoints()
Specified by:
getWeldInjectionPoints in class RIBean<T>

getNewInjectionPoints

public Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()

getMergedStereotypes

protected MergedStereotypes<T,S> getMergedStereotypes()
Gets the merged stereotypes of the bean

Returns:
The set of merged stereotypes

getName

public String getName()
Gets the name of the bean

Returns:
The name
See Also:
Bean.getName()

getScope

public Class<? extends Annotation> getScope()
Gets the scope type of the bean

Returns:
The scope type
See Also:
Bean.getScope()

getType

public Class<T> getType()
Gets the type of the bean

Specified by:
getType in class RIBean<T>
Returns:
The type

getTypes

public Set<Type> getTypes()
Gets the API types of the bean

Returns:
The set of API types
See Also:
Bean.getTypes()

isNullable

public boolean isNullable()
Indicates if bean is nullable

Returns:
True if nullable, false otherwise
See Also:
Bean.isNullable()

isPrimitive

public boolean isPrimitive()
Indicates if bean type is a primitive

Specified by:
isPrimitive in class RIBean<T>
Returns:
True if primitive, false otherwise

isDependent

public boolean isDependent()
Overrides:
isDependent in class RIBean<T>

isNormalScoped

public boolean isNormalScoped()

isAlternative

public boolean isAlternative()

isSpecializing

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

getStereotypes

public Set<Class<? extends Annotation>> getStereotypes()

isInitialized

protected boolean isInitialized()

isProxyRequired

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

getServices

protected org.jboss.weld.bootstrap.api.ServiceRegistry getServices()

hasDefaultProducer

public abstract boolean hasDefaultProducer()
Returns true if the bean uses the default Producer ( or InjectionTarget). The method returns false if the producer of the bean was replaced by an extension.



Copyright © 2013 Seam Framework. All Rights Reserved.