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

java.lang.Object
  extended by javax.inject.manager.Bean<T>
      extended by org.jboss.webbeans.bean.RIBean<T>
          extended by org.jboss.webbeans.bean.AbstractBean<T,java.lang.Class<T>>
              extended by org.jboss.webbeans.bean.AbstractClassBean<T>
Type Parameters:
T -
E -
All Implemented Interfaces:
Contextual<T>
Direct Known Subclasses:
EnterpriseBean, SimpleBean

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  AnnotatedClass<T> annotatedItem
           
 
Fields inherited from class org.jboss.webbeans.bean.AbstractBean
_serializable, bindings, dependentInstancesStore, deploymentType, injectionPoints, manager, name, scopeType, type, types
 
Constructor Summary
protected AbstractClassBean(AnnotatedClass<T> type, ManagerImpl manager)
          Constructor
 
Method Summary
protected  void callInitializers(T instance, CreationalContext<T> creationalContext)
          Calls all initializers of the bean
protected  void checkBeanImplementation()
          Validates the bean implementation
protected  void checkScopeAllowed()
          Validate that the scope type is allowed by the stereotypes on the bean and the bean type
 AnnotatedClass<T> getAnnotatedItem()
          Gets the annotated item
protected  java.lang.Class<? extends java.lang.annotation.Annotation> getDefaultDeploymentType()
          Gets the default deployment type
protected  java.lang.String getDefaultName()
          Gets the default name
 java.lang.String getId()
           
 java.util.Set<? extends MethodInjectionPoint<?>> getInitializerMethods()
          Gets the annotated methods
 java.util.Set<java.lang.String> getSuperclasses()
           
protected  void initDeploymentType()
          Initializes the deployment types
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initInitializerMethods()
          Initializes the initializer methods
protected  void initInjectionPoints()
          Initializes the injection points
protected  void initScopeType()
          Initializes the scope type
protected  void initType()
          Initializes the bean type
protected  void injectBoundFields(T instance, CreationalContext<T> creationalContext)
          Injects bound fields
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class org.jboss.webbeans.bean.AbstractBean
checkDeploymentType, checkRequiredTypesImplemented, getBindings, getDeploymentType, getDeploymentType, getInjectionPoints, getMergedStereotypes, getName, getScopeType, getSpecializedBean, getType, getTypes, initBindings, initDefaultBindings, initDeploymentTypeFromStereotype, initName, initPrimitive, initProxyable, initScopeTypeFromStereotype, initSerializable, initTypes, isAssignableFrom, isDependent, isInitialized, isNullable, isPrimitive, isProxyable, isSerializable, isSpecializing, postSpecialize, specialize
 
Methods inherited from class org.jboss.webbeans.bean.RIBean
createId, equals, getManager, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.context.Contextual
create, destroy
 

Field Detail

annotatedItem

protected AnnotatedClass<T> annotatedItem
Constructor Detail

AbstractClassBean

protected AbstractClassBean(AnnotatedClass<T> type,
                            ManagerImpl manager)
Constructor

Parameters:
type - The type
manager - The Web Beans 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>>

injectBoundFields

protected void injectBoundFields(T instance,
                                 CreationalContext<T> creationalContext)
Injects bound fields

Parameters:
instance - The instance to inject into

callInitializers

protected void callInitializers(T instance,
                                CreationalContext<T> creationalContext)
Calls all initializers of the bean

Parameters:
instance - The bean instance

initType

protected void initType()
Initializes the bean type


initInjectionPoints

protected void initInjectionPoints()
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>>

initDeploymentType

protected void initDeploymentType()
Description copied from class: AbstractBean
Initializes the deployment types

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

checkScopeAllowed

protected void checkScopeAllowed()
Validate that the scope type is allowed by the stereotypes on the bean and the bean type


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 AnnotatedClass<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.Set<? extends MethodInjectionPoint<?>> getInitializerMethods()
Gets the annotated methods

Returns:
The set of annotated methods

getSuperclasses

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

toString

public java.lang.String toString()
Gets a string representation

Overrides:
toString in class AbstractBean<T,java.lang.Class<T>>
Returns:
The string representation

getDefaultDeploymentType

protected java.lang.Class<? extends java.lang.annotation.Annotation> getDefaultDeploymentType()
Description copied from class: AbstractBean
Gets the default deployment type

Specified by:
getDefaultDeploymentType in class AbstractBean<T,java.lang.Class<T>>
Returns:
The default deployment type

getId

public java.lang.String getId()
Specified by:
getId in class RIBean<T>


Copyright © 2011. All Rights Reserved.