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  java.util.Set<java.lang.annotation.Annotation> bindings
           
protected  BeanManagerImpl manager
           
protected  java.lang.String name
           
protected  java.lang.Class<? extends java.lang.annotation.Annotation> scopeType
           
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 manager)
          Constructor
 
Method Summary
protected  void addInjectionPoint(WeldInjectionPoint<?,?> injectionPoint)
           
protected  void addInjectionPoints(java.lang.Iterable<? extends WeldInjectionPoint<?,?>> injectionPoints)
           
protected  void checkDelegateInjectionPoints()
           
 java.util.Set<WeldInjectionPoint<?,?>> getAnnotatedInjectionPoints()
           
abstract  WeldAnnotated<T,S> getAnnotatedItem()
          Returns the annotated time the bean represents
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<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
 java.util.Set<java.lang.reflect.Type> getTypes()
          Gets the API types of the bean
protected  void initBindings()
          Initializes the binding types
protected  void initDefaultBindings()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initName()
          Initializes the name
protected  void initPolicy()
           
protected  void initPrimitive()
          Initializes the primitive flag
protected  void initProxyable()
           
protected abstract  void initScopeType()
          Initializes the scope type
protected  boolean initScopeTypeFromStereotype()
           
protected  void initSerializable()
           
protected  void initStereotypes()
           
protected  void initTypes()
          Initializes the API types
 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 isSerializable()
           
 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, getDescription, getId, getInjectionPoints, 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
create, destroy
 

Field Detail

bindings

protected java.util.Set<java.lang.annotation.Annotation> bindings

name

protected java.lang.String name

scopeType

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

type

protected java.lang.Class<T> type

types

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

manager

protected BeanManagerImpl manager
Constructor Detail

AbstractBean

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

Parameters:
manager - The Bean manager
Method Detail

isInitialized

protected boolean isInitialized()

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()
Initializes the API types


initBindings

protected void initBindings()
Initializes the binding types


initDefaultBindings

protected void initDefaultBindings()

initPolicy

protected void initPolicy()

initName

protected void initName()
Initializes the name


initProxyable

protected void initProxyable()

initPrimitive

protected void initPrimitive()
Initializes the primitive flag


initScopeType

protected abstract void initScopeType()
Initializes the scope type


initScopeTypeFromStereotype

protected boolean initScopeTypeFromStereotype()

postSpecialize

protected void postSpecialize()

preSpecialize

protected void preSpecialize(BeanDeployerEnvironment environment)

specialize

protected void specialize(BeanDeployerEnvironment environment)

getAnnotatedItem

public abstract WeldAnnotated<T,S> getAnnotatedItem()
Returns the annotated time 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>

getAnnotatedInjectionPoints

public java.util.Set<WeldInjectionPoint<?,?>> getAnnotatedInjectionPoints()
Specified by:
getAnnotatedInjectionPoints in class RIBean<T>

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

isSerializable

public boolean isSerializable()

initSerializable

protected void initSerializable()

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


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