org.jboss.webbeans.bean
Class EnterpriseBean<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>
                  extended by org.jboss.webbeans.bean.EnterpriseBean<T>
Type Parameters:
T - The type (class) of the bean
All Implemented Interfaces:
Contextual<T>
Direct Known Subclasses:
NewEnterpriseBean

public class EnterpriseBean<T>
extends AbstractClassBean<T>

An enterprise bean representation

Author:
Pete Muir

Field Summary
 
Fields inherited from class org.jboss.webbeans.bean.AbstractClassBean
annotatedItem
 
Fields inherited from class org.jboss.webbeans.bean.AbstractBean
_serializable, dependentInstancesStore, deploymentType, injectionPoints, manager, name, scopeType, type, types
 
Constructor Summary
protected EnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager)
          Constructor
 
Method Summary
 boolean canCallRemoveMethods()
           
protected  void checkConflictingRoles()
          Validates for non-conflicting roles
protected  void checkEnterpriseScopeAllowed()
          Check that the scope type is allowed by the stereotypes on the bean and the bean type
protected  void checkObserverMethods()
          If there are any observer methods, they must be static or business methods.
 T create(CreationalContext<T> creationalContext)
          Creates an instance of the bean
 void destroy(T instance)
          Destroys an instance of the bean
 InternalEjbDescriptor<T> getEjbDescriptor()
           
 AbstractBean<?,?> getSpecializedBean()
           
protected  void init()
          Initializes the bean and its metadata
protected  void initProxyClass()
           
protected  void initSpecialization()
           
protected  void initTypes()
          Initializes the API types
protected  void injectEjbAndCommonFields()
          Injects EJBs and common fields
 boolean isSerializable()
           
static
<T> EnterpriseBean<T>
of(AnnotatedClass<T> clazz, ManagerImpl manager)
           
static
<T> EnterpriseBean<T>
of(java.lang.Class<T> clazz, ManagerImpl manager)
          Creates a simple, annotation defined Enterprise Web Bean
 void postConstruct(T instance)
           
protected  void preCheckSpecialization()
          Validates specialization
 void preDestroy(T instance)
           
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class org.jboss.webbeans.bean.AbstractClassBean
callInitializers, checkBeanImplementation, checkScopeAllowed, equals, getAnnotatedItem, getDefaultDeploymentType, getDefaultName, getInitializerMethods, initDeploymentType, initInitializerMethods, initInjectionPoints, initScopeType, initType, injectBoundFields
 
Methods inherited from class org.jboss.webbeans.bean.AbstractBean
bindDecorators, bindInterceptors, checkDeploymentType, checkInjectionPointsAreSerializable, checkRequiredTypesImplemented, getBindings, getDependentInstancesStore, getDeploymentType, getDeploymentType, getInjectionPoints, getMergedStereotypes, getName, getScopeType, getType, getTypes, hashCode, initBindingTypes, initDefaultBindings, initDeploymentTypeFromStereotype, initName, initPrimitive, initProxyable, initScopeTypeFromStereotype, initSerializable, isAssignableFrom, isDependent, isNullable, isPrimitive, isProxyable, isSpecializing, postSpecialization
 
Methods inherited from class org.jboss.webbeans.bean.RIBean
getManager
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnterpriseBean

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

Parameters:
type - The type of the bean
manager - The Web Beans manager
Method Detail

of

public static <T> EnterpriseBean<T> of(java.lang.Class<T> clazz,
                                       ManagerImpl manager)
Creates a simple, annotation defined Enterprise Web Bean

Type Parameters:
T - The type
Parameters:
clazz - The class
manager - the current manager
Returns:
An Enterprise Web Bean

of

public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz,
                                       ManagerImpl manager)

init

protected void init()
Initializes the bean and its metadata

Overrides:
init in class AbstractClassBean<T>

initTypes

protected void initTypes()
Description copied from class: AbstractBean
Initializes the API types

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

initProxyClass

protected void initProxyClass()

checkConflictingRoles

protected void checkConflictingRoles()
Validates for non-conflicting roles


checkEnterpriseScopeAllowed

protected void checkEnterpriseScopeAllowed()
Check that the scope type is allowed by the stereotypes on the bean and the bean type


preCheckSpecialization

protected void preCheckSpecialization()
Validates specialization

Overrides:
preCheckSpecialization in class AbstractClassBean<T>

initSpecialization

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

create

public T create(CreationalContext<T> creationalContext)
Creates an instance of the bean

Returns:
The instance

destroy

public void destroy(T instance)
Destroys an instance of the bean

Parameters:
instance - The instance

injectEjbAndCommonFields

protected void injectEjbAndCommonFields()
Injects EJBs and common fields


toString

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

Overrides:
toString in class AbstractClassBean<T>
Returns:
The string representation

postConstruct

public void postConstruct(T instance)

preDestroy

public void preDestroy(T instance)

isSerializable

public boolean isSerializable()
Overrides:
isSerializable in class AbstractBean<T,java.lang.Class<T>>

getEjbDescriptor

public InternalEjbDescriptor<T> getEjbDescriptor()

canCallRemoveMethods

public boolean canCallRemoveMethods()

getSpecializedBean

public AbstractBean<?,?> getSpecializedBean()
Specified by:
getSpecializedBean in class AbstractBean<T,java.lang.Class<T>>

checkObserverMethods

protected void checkObserverMethods()
If there are any observer methods, they must be static or business methods.



Copyright © 2008-2009. All Rights Reserved.