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 - the type of class for the bean
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, David Allen

Field Summary
protected  WeldClass<T> annotatedItem
           
 
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
protected AbstractClassBean(WeldClass<T> type, java.lang.String idSuffix, BeanManagerImpl beanManager)
          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 checkConstructor()
           
 void checkType()
           
protected  void defaultPostConstruct(T instance)
           
protected  void defaultPreDestroy(T instance)
           
protected static java.util.Set<java.lang.annotation.Annotation> flattenInterceptorBindings(BeanManagerImpl beanManager, java.util.Set<java.lang.annotation.Annotation> annotations)
          Extracts the complete set of interception bindings from a given set of annotations.
 ConstructorInjectionPoint<T> getConstructor()
          Returns the constructor
 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()
           
 java.util.List<WeldMethod<?,? super T>> getPostConstruct()
          Returns the post-construct method
 java.util.List<WeldMethod<?,? super T>> getPreDestroy()
          Returns the pre-destroy method
 WeldClass<T> getWeldAnnotated()
          Gets the annotated item
 boolean hasCdiBoundInterceptors()
           
 boolean hasDecorators()
           
 boolean hasDirectlyDefinedInterceptors()
           
protected  void initCdiBoundInterceptors()
           
protected  void initConstructor()
          Initializes the constructor
 void initDecorators()
           
protected  void initDirectlyDefinedInterceptors()
           
 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 initInitializerMethods()
          Initializes the initializer methods
protected  void initInjectableFields()
          Initializes the injection points
protected  void initPostConstruct()
          Initializes the post-construct method
protected  void initPreDestroy()
          Initializes the pre-destroy method
protected  void initProxyClassForDecoratedBean()
           
protected  void initScope()
           
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, getDelegateInjectionPoints, getMergedStereotypes, getName, getNewInjectionPoints, getQualifiers, getScope, getSpecializedBean, getStereotypes, getType, getTypedTypes, getTypes, getWeldInjectionPoints, initAlternative, initDefaultQualifiers, initName, initQualifiers, initScopeFromStereotype, initStereotypes, initTypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSpecializing, postSpecialize, specialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getBeanManager, getId, hashCode, 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

annotatedItem

protected WeldClass<T> annotatedItem
Constructor Detail

AbstractClassBean

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

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

flattenInterceptorBindings

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

Parameters:
beanManager -
annotations -
Returns:

initialize

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

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

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)

Overrides:
initializeAfterBeanDiscovery in class RIBean<T>

checkType

public void checkType()
Overrides:
checkType in class RIBean<T>

initDecorators

public 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


initScope

protected void initScope()
Specified by:
initScope 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>>

getWeldAnnotated

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

Specified by:
getWeldAnnotated 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

initPostConstruct

protected void initPostConstruct()
Initializes the post-construct method


initPreDestroy

protected void initPreDestroy()
Initializes the pre-destroy method


getPostConstruct

public java.util.List<WeldMethod<?,? super T>> getPostConstruct()
Returns the post-construct method

Returns:
The post-construct method

getPreDestroy

public java.util.List<WeldMethod<?,? super T>> getPreDestroy()
Returns the pre-destroy method

Returns:
The pre-destroy method

isInterceptionCandidate

protected abstract boolean isInterceptionCandidate()

initCdiBoundInterceptors

protected void initCdiBoundInterceptors()

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)

hasCdiBoundInterceptors

public boolean hasCdiBoundInterceptors()

hasDirectlyDefinedInterceptors

public boolean hasDirectlyDefinedInterceptors()

initDirectlyDefinedInterceptors

protected void initDirectlyDefinedInterceptors()

checkConstructor

protected void checkConstructor()

initConstructor

protected void initConstructor()
Initializes the constructor


getConstructor

public ConstructorInjectionPoint<T> getConstructor()
Returns the constructor

Returns:
The constructor


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