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

Field Summary
protected  boolean alternative
           
protected  BeanManagerImpl beanManager
           
protected  java.lang.String name
           
protected  java.util.Set<java.lang.annotation.Annotation> qualifiers
           
protected  java.lang.Class<? extends java.lang.annotation.Annotation> scope
           
protected  java.lang.Class<T> type
           
protected  java.util.Set<java.lang.reflect.Type> types
           
 
Fields inherited from class org.jboss.weld.bean.RIBean
BEAN_ID_PREFIX, BEAN_ID_SEPARATOR
 
Constructor Summary
AbstractBean(java.lang.String idSuffix, BeanManagerImpl beanManager)
          Constructor
 
Method Summary
protected  void addInjectionPoint(WeldInjectionPoint<?,?> injectionPoint)
           
protected  void addInjectionPoints(java.lang.Iterable<? extends WeldInjectionPoint<?,?>> injectionPoints)
           
protected  void checkDelegateInjectionPoints()
           
protected abstract  java.lang.String getDefaultName()
          Gets the default name of the bean
protected  java.util.Set<WeldInjectionPoint<?,?>> getDelegateInjectionPoints()
           
protected  MergedStereotypes<T,S> getMergedStereotypes()
          Gets the merged stereotypes of the bean
 java.lang.String getName()
          Gets the name of the bean
 java.util.Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()
           
 java.util.Set<java.lang.annotation.Annotation> getQualifiers()
          Gets the binding types
 java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
          Gets the scope type of the bean
abstract  AbstractBean<?,?> getSpecializedBean()
           
 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
           
 java.lang.Class<T> getType()
          Gets the type of the bean
protected static java.util.Set<java.lang.reflect.Type> getTypedTypes(java.util.Map<java.lang.Class<?>,java.lang.reflect.Type> typeClosure, java.lang.Class<?> rawType, javax.enterprise.inject.Typed typed)
           
 java.util.Set<java.lang.reflect.Type> getTypes()
          Gets the API types of the bean
abstract  WeldAnnotated<T,S> getWeldAnnotated()
          Returns the annotated item the bean represents
 java.util.Set<WeldInjectionPoint<?,?>> getWeldInjectionPoints()
           
protected  void initAlternative()
           
protected  void initDefaultQualifiers()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
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 isProxyable()
           
 boolean isSpecializing()
           
protected  void postSpecialize()
           
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 
Methods inherited from class org.jboss.weld.bean.RIBean
checkType, equals, getBeanClass, getBeanManager, getId, getInjectionPoints, hashCode, initializeAfterBeanDiscovery, isPassivationCapableBean, isPassivationCapableDependency, isProxyRequired, 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 java.util.Set<java.lang.annotation.Annotation> qualifiers

name

protected java.lang.String name

scope

protected java.lang.Class<? extends java.lang.annotation.Annotation> scope

alternative

protected boolean alternative

type

protected java.lang.Class<T> type

types

protected java.util.Set<java.lang.reflect.Type> types

beanManager

protected BeanManagerImpl beanManager
Constructor Detail

AbstractBean

public AbstractBean(java.lang.String idSuffix,
                    BeanManagerImpl beanManager)
Constructor

Parameters:
beanManager - The Bean manager
Method Detail

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()

addInjectionPoint

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

addInjectionPoints

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

getDelegateInjectionPoints

protected java.util.Set<WeldInjectionPoint<?,?>> getDelegateInjectionPoints()

initTypes

protected void initTypes()

getTypedTypes

protected static java.util.Set<java.lang.reflect.Type> getTypedTypes(java.util.Map<java.lang.Class<?>,java.lang.reflect.Type> typeClosure,
                                                                     java.lang.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 java.util.Set<java.lang.annotation.Annotation> getQualifiers()
Gets the binding types

Returns:
The set of binding types
See Also:
org.jboss.weld.bean.BaseBean#getQualifiers()

getDefaultName

protected abstract java.lang.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 java.util.Set<WeldInjectionPoint<?,?>> getWeldInjectionPoints()
Specified by:
getWeldInjectionPoints in class RIBean<T>

getNewInjectionPoints

public java.util.Set<WeldInjectionPoint<?,?>> getNewInjectionPoints()

getMergedStereotypes

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

Returns:
The set of merged stereotypes

getName

public java.lang.String getName()
Gets the name of the bean

Returns:
The name
See Also:
org.jboss.weld.bean.BaseBean#getName()

getScope

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

Returns:
The scope type
See Also:
org.jboss.weld.bean.BaseBean#getScope()

getType

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

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

getTypes

public java.util.Set<java.lang.reflect.Type> getTypes()
Gets the API types of the bean

Returns:
The set of API types
See Also:
org.jboss.weld.bean.BaseBean#getTypeClosure()

isNullable

public boolean isNullable()
Indicates if bean is nullable

Returns:
True if nullable, false otherwise
See Also:
org.jboss.weld.bean.BaseBean#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

isProxyable

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

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 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()

isInitialized

protected boolean isInitialized()


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