org.jboss.weld.bean
Class AbstractClassBean<T>

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

public abstract class AbstractClassBean<T>
extends AbstractBean<T,java.lang.Class<T>>

An abstract bean representation common for class-based beans

Author:
Pete Muir

Field Summary
protected  WeldClass<T> annotatedItem
           
 
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
protected AbstractClassBean(WeldClass<T> type, java.lang.String idSuffix, BeanManagerImpl manager)
          Constructor
 
Method Summary
protected  T applyDecorators(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext, javax.enterprise.inject.spi.InjectionPoint originalInjectionPoint)
           
protected  void checkBeanImplementation()
          Validates the bean implementation
protected  void checkType()
           
protected  void defaultPostConstruct(T instance)
           
protected  void defaultPreDestroy(T instance)
           
protected static java.util.Set<java.lang.annotation.Annotation> flattenInterceptorBindings(BeanManagerImpl manager, java.util.Set<java.lang.annotation.Annotation> annotations)
          Extracts the complete set of interception bindings from a given set of annotations.
 WeldClass<T> getAnnotatedItem()
          Gets the annotated item
 java.util.List<javax.enterprise.inject.spi.Decorator<?>> getDecorators()
           
protected  java.lang.String getDefaultName()
          Gets the default name
 java.util.List<? extends java.util.Set<? extends MethodInjectionPoint<?,?>>> getInitializerMethods()
          Gets the annotated methods
 java.util.List<? extends java.util.Set<FieldInjectionPoint<?,?>>> getInjectableFields()
           
 java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 javax.enterprise.inject.spi.InjectionTarget<T> getInjectionTarget()
           
 WeldMethod<?,?> getPostConstruct()
          Returns the post-construct method
 WeldMethod<?,?> getPreDestroy()
          Returns the pre-destroy method
 java.util.Set<java.lang.String> getSuperclasses()
           
 boolean hasDecorators()
           
protected  void initDecorators()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initInitializerMethods()
          Initializes the initializer methods
protected  void initInjectableFields()
          Initializes the injection points
protected  void initInterceptors()
           
protected  void initPostConstruct()
          Initializes the post-construct method
protected  void initPreDestroy()
          Initializes the pre-destroy method
protected  void initProxyClassForDecoratedBean()
           
protected  void initScopeType()
          Initializes the scope type
protected  void initType()
          Initializes the bean type
protected abstract  boolean isInterceptionCandidate()
           
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
 void setInjectionTarget(javax.enterprise.inject.spi.InjectionTarget<T> injectionTarget)
           
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, getAnnotatedInjectionPoints, getDelegateInjectionPoints, getMergedStereotypes, getName, getQualifiers, getScope, getSpecializedBean, getStereotypes, getType, getTypes, initBindings, initDefaultBindings, initName, initPolicy, initPrimitive, initProxyable, initScopeTypeFromStereotype, initSerializable, initStereotypes, initTypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSerializable, isSpecializing, postSpecialize, specialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getDescription, 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
create, destroy
 

Field Detail

annotatedItem

protected WeldClass<T> annotatedItem
Constructor Detail

AbstractClassBean

protected AbstractClassBean(WeldClass<T> type,
                            java.lang.String idSuffix,
                            BeanManagerImpl manager)
Constructor

Parameters:
type - The type
manager - The Bean manager
Method Detail

initialize

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

Overrides:
initialize in class AbstractBean<T,java.lang.Class<T>>

checkType

protected void checkType()

initDecorators

protected void initDecorators()

hasDecorators

public boolean hasDecorators()

initProxyClassForDecoratedBean

protected void initProxyClassForDecoratedBean()

applyDecorators

protected T applyDecorators(T instance,
                            javax.enterprise.context.spi.CreationalContext<T> creationalContext,
                            javax.enterprise.inject.spi.InjectionPoint originalInjectionPoint)

getDecorators

public java.util.List<javax.enterprise.inject.spi.Decorator<?>> getDecorators()

initType

protected void initType()
Initializes the bean type


initInjectableFields

protected void initInjectableFields()
Initializes the injection points


initInitializerMethods

protected void initInitializerMethods()
Initializes the initializer methods


initScopeType

protected void initScopeType()
Description copied from class: AbstractBean
Initializes the scope type

Specified by:
initScopeType in class AbstractBean<T,java.lang.Class<T>>

checkBeanImplementation

protected void checkBeanImplementation()
Validates the bean implementation


preSpecialize

protected void preSpecialize(BeanDeployerEnvironment environment)
Overrides:
preSpecialize in class AbstractBean<T,java.lang.Class<T>>

getAnnotatedItem

public WeldClass<T> getAnnotatedItem()
Gets the annotated item

Specified by:
getAnnotatedItem in class AbstractBean<T,java.lang.Class<T>>
Returns:
The annotated item

getDefaultName

protected java.lang.String getDefaultName()
Gets the default name

Specified by:
getDefaultName in class AbstractBean<T,java.lang.Class<T>>
Returns:
The default name

getInitializerMethods

public java.util.List<? extends java.util.Set<? extends MethodInjectionPoint<?,?>>> getInitializerMethods()
Gets the annotated methods

Returns:
The set of annotated methods

getInjectableFields

public java.util.List<? extends java.util.Set<FieldInjectionPoint<?,?>>> getInjectableFields()
Returns:
the injectableFields

getSuperclasses

public java.util.Set<java.lang.String> getSuperclasses()

initPostConstruct

protected void initPostConstruct()
Initializes the post-construct method


initPreDestroy

protected void initPreDestroy()
Initializes the pre-destroy method


getPostConstruct

public WeldMethod<?,?> getPostConstruct()
Returns the post-construct method

Returns:
The post-construct method

getPreDestroy

public WeldMethod<?,?> getPreDestroy()
Returns the pre-destroy method

Returns:
The pre-destroy method

isInterceptionCandidate

protected abstract boolean isInterceptionCandidate()

flattenInterceptorBindings

protected static java.util.Set<java.lang.annotation.Annotation> flattenInterceptorBindings(BeanManagerImpl manager,
                                                                                           java.util.Set<java.lang.annotation.Annotation> annotations)
Extracts the complete set of interception bindings from a given set of annotations.

Parameters:
manager -
annotations -
Returns:

initInterceptors

protected void initInterceptors()

setInjectionTarget

public void setInjectionTarget(javax.enterprise.inject.spi.InjectionTarget<T> injectionTarget)

getInjectionTarget

public javax.enterprise.inject.spi.InjectionTarget<T> getInjectionTarget()

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>

defaultPreDestroy

protected void defaultPreDestroy(T instance)

defaultPostConstruct

protected void defaultPostConstruct(T instance)


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