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, bindings, dependentInstancesStore, deploymentType, injectionPoints, manager, name, scopeType, type, types
 
Constructor Summary
protected EnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager, BeanDeployerEnvironment environment)
          Constructor
 
Method Summary
 boolean canCallRemoveMethods()
           
protected  void checkConflictingRoles()
          Validates for non-conflicting roles
protected  void checkObserverMethods()
          If there are any observer methods, they must be static or business methods.
protected  void checkScopeAllowed()
          Check that the scope type is allowed by the stereotypes on the bean and the bean type
 T create(CreationalContext<T> creationalContext)
          Creates an instance of the bean
 SessionObjectReference createReference()
           
 void destroy(T instance)
          Destroys an instance of the contexual type
 InternalEjbDescriptor<T> getEjbDescriptor()
           
 AbstractBean<?,?> getSpecializedBean()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initProxyClass()
           
protected  void initSerializable()
           
protected  void initTypes()
          Initializes the API types
 boolean isMethodExistsOnTypes(AnnotatedMethod<?> method)
           
static
<T> EnterpriseBean<T>
of(AnnotatedClass<T> clazz, ManagerImpl manager, BeanDeployerEnvironment environment)
          Creates a simple, annotation defined Enterprise Web Bean
 void postConstruct(T instance)
           
 void preDestroy(T instance)
           
protected  void preSpecialize(BeanDeployerEnvironment environment)
          Validates specialization
protected  void specialize(BeanDeployerEnvironment environment)
           
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class org.jboss.webbeans.bean.AbstractClassBean
callInitializers, checkBeanImplementation, getAnnotatedItem, getDefaultDeploymentType, getDefaultName, getId, getInitializerMethods, getSuperclasses, initDeploymentType, initInitializerMethods, initInjectionPoints, initScopeType, initType, injectBoundFields
 
Methods inherited from class org.jboss.webbeans.bean.AbstractBean
checkDeploymentType, checkRequiredTypesImplemented, getBindings, getDeploymentType, getDeploymentType, getInjectionPoints, getMergedStereotypes, getName, getScopeType, getType, getTypes, initBindings, initDefaultBindings, initDeploymentTypeFromStereotype, initName, initPrimitive, initProxyable, initScopeTypeFromStereotype, isAssignableFrom, isDependent, isInitialized, isNullable, isPrimitive, isProxyable, isSerializable, isSpecializing, postSpecialize
 
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
 

Constructor Detail

EnterpriseBean

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

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

of

public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz,
                                       ManagerImpl manager,
                                       BeanDeployerEnvironment environment)
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

initialize

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

Overrides:
initialize 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


checkScopeAllowed

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

Overrides:
checkScopeAllowed in class AbstractClassBean<T>

preSpecialize

protected void preSpecialize(BeanDeployerEnvironment environment)
Validates specialization

Overrides:
preSpecialize in class AbstractClassBean<T>

specialize

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

create

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

Parameters:
creationalContext - the creational context in which incompletely initialized contexts may be placed
Returns:
The instance

destroy

public void destroy(T instance)
Description copied from interface: Contextual
Destroys an instance of the contexual type

Parameters:
instance - the insance to destroy

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)

initSerializable

protected void initSerializable()
Overrides:
initSerializable 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.


isMethodExistsOnTypes

public boolean isMethodExistsOnTypes(AnnotatedMethod<?> method)

createReference

public SessionObjectReference createReference()


Copyright © 2011. All Rights Reserved.