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,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,Class<T>>

An abstract bean representation common for class-based beans

Author:
Pete Muir, David Allen, Marko Luksa

Field Summary
protected  WeldClass<T> annotatedItem
           
protected  WeldConstructor<T> constructorForEnhancedSubclass
           
protected  ProxyFactory<T> decoratorProxyFactory
           
protected  WeldClass<T> enhancedSubclass
           
 
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, String idSuffix, BeanManagerImpl beanManager, org.jboss.weld.bootstrap.api.ServiceRegistry services)
          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()
           
protected  Class<T> createEnhancedSubclass()
           
protected  void defaultPostConstruct(T instance)
           
protected  void defaultPreDestroy(T instance)
           
 ConstructorInjectionPoint<T> getConstructor()
          Returns the constructor
 List<javax.enterprise.inject.spi.Decorator<?>> getDecorators()
           
protected  String getDefaultName()
          Gets the default name
 List<? extends Set<? extends MethodInjectionPoint<?,?>>> getInitializerMethods()
          Gets the annotated methods
 List<? extends Set<FieldInjectionPoint<?,?>>> getInjectableFields()
           
 Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 javax.enterprise.inject.spi.InjectionTarget<T> getInjectionTarget()
           
 List<WeldMethod<?,? super T>> getPostConstruct()
          Returns the post-construct method
 List<WeldMethod<?,? super T>> getPreDestroy()
          Returns the pre-destroy method
 WeldClass<T> getWeldAnnotated()
          Gets the annotated item
 boolean hasDecorators()
           
 boolean hasInterceptors()
           
protected  void initConstructor()
          Initializes the constructor
 void initDecorators()
           
protected  void initEnhancedSubclass()
           
 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 initInterceptorsIfNeeded()
           
protected  void initPostConstruct()
          Initializes the post-construct method
protected  void initPreDestroy()
          Initializes the pre-destroy method
protected  void initScope()
           
protected  void initType()
          Initializes the bean type
protected abstract  boolean isInterceptionCandidate()
           
protected  boolean isSubclassed()
           
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, checkType, cleanupAfterBoot, getDelegateInjectionPoints, getMergedStereotypes, getName, getNewInjectionPoints, getQualifiers, getScope, getServices, getSpecializedBean, getStereotypes, getType, getTypedTypes, getTypes, getWeldInjectionPoints, hasDefaultProducer, initAlternative, initDefaultQualifiers, initName, initQualifiers, initScopeFromStereotype, initStereotypes, initTypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyRequired, isSpecializing, postSpecialize, specialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getBeanManager, getId, 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

annotatedItem

protected WeldClass<T> annotatedItem

enhancedSubclass

protected WeldClass<T> enhancedSubclass

constructorForEnhancedSubclass

protected WeldConstructor<T> constructorForEnhancedSubclass

decoratorProxyFactory

protected ProxyFactory<T> decoratorProxyFactory
Constructor Detail

AbstractClassBean

protected AbstractClassBean(WeldClass<T> type,
                            String idSuffix,
                            BeanManagerImpl beanManager,
                            org.jboss.weld.bootstrap.api.ServiceRegistry services)
Constructor

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

initialize

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

Overrides:
initialize in class AbstractBean<T,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 AbstractBean<T,Class<T>>

initInterceptorsIfNeeded

protected void initInterceptorsIfNeeded()

initDecorators

public void initDecorators()

hasDecorators

public boolean hasDecorators()

applyDecorators

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

getDecorators

public 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,Class<T>>

checkBeanImplementation

protected void checkBeanImplementation()
Validates the bean implementation


preSpecialize

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

getWeldAnnotated

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

Specified by:
getWeldAnnotated in class AbstractBean<T,Class<T>>
Returns:
The annotated item

getDefaultName

protected String getDefaultName()
Gets the default name

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

getInitializerMethods

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

Returns:
The set of annotated methods

getInjectableFields

public List<? extends 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 List<WeldMethod<?,? super T>> getPostConstruct()
Returns the post-construct method

Returns:
The post-construct method

getPreDestroy

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

Returns:
The pre-destroy method

isInterceptionCandidate

protected abstract boolean isInterceptionCandidate()

setInjectionTarget

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

getInjectionTarget

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

getInjectionPoints

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

hasInterceptors

public boolean hasInterceptors()

checkConstructor

protected void checkConstructor()

initConstructor

protected void initConstructor()
Initializes the constructor


getConstructor

public ConstructorInjectionPoint<T> getConstructor()
Returns the constructor

Returns:
The constructor

isSubclassed

protected boolean isSubclassed()

initEnhancedSubclass

protected void initEnhancedSubclass()

createEnhancedSubclass

protected Class<T> createEnhancedSubclass()


Copyright © 2013 Seam Framework. All Rights Reserved.