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

java.lang.Object
  extended by javax.webbeans.manager.Bean<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 -
All Implemented Interfaces:
Contextual<T>

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
apiTypes, deploymentType, injectionPoints, manager, name, scopeType, type
 
Constructor Summary
EnterpriseBean(java.lang.Class<T> type, ManagerImpl manager)
          Constructor
 
Method Summary
protected  void callInitializers(T instance)
          Calls all initializers of the bean
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
 T create()
          Creates an instance of the bean
 void destroy(T instance)
          Destroys an instance of the bean
 AnnotatedMethod<?> getRemoveMethod()
           
protected  AbstractBean<? extends T,java.lang.Class<T>> getSpecializedType()
          Gets the specializes type of the bean
protected  void init()
          Initializes the bean and its metadata
protected  void initInjectionPoints()
          Initializes the injection points
protected  void initRemoveMethod()
          Initializes the remvoe method
protected  void injectBoundFields(T instance, Manager manager)
          Injects bound fields
protected  void injectEjbAndCommonFields()
          Injects EJBs and common fields
 void postConstruct(T instance)
           
 void preDestroy(java.lang.Object target)
           
 java.lang.String toString()
          Gets a string representation
 
Methods inherited from class org.jboss.webbeans.bean.AbstractClassBean
checkBeanImplementation, checkRequiredTypesImplemented, checkScopeAllowed, getAnnotatedItem, getDefaultDeploymentType, getDefaultName, getInitializerMethods, getInjectableFields, getObserverMethods, getProducerFields, getProducerMethods, initInitializerMethods, initType, toDetailedString
 
Methods inherited from class org.jboss.webbeans.bean.AbstractBean
bindDecorators, bindInterceptors, checkDeploymentType, getBindingTypes, getDeclaredBeanType, getDeploymentType, getDeploymentType, getInjectionPoints, getMergedStereotypes, getName, getScopeType, getType, getTypes, initApiTypes, initBindingTypes, initDeploymentType, initName, initPrimitive, initScopeType, isAssignableFrom, isNullable, isPrimitive, isSerializable
 
Methods inherited from class javax.webbeans.manager.Bean
getManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnterpriseBean

public EnterpriseBean(java.lang.Class<T> type,
                      ManagerImpl manager)
Constructor

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

init

protected void init()
Initializes the bean and its metadata

Overrides:
init in class AbstractClassBean<T>

initInjectionPoints

protected void initInjectionPoints()
Initializes the injection points

Overrides:
initInjectionPoints in class AbstractClassBean<T>

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


initRemoveMethod

protected void initRemoveMethod()
Initializes the remvoe method


create

public T create()
Creates an instance of the bean

Specified by:
create in interface Contextual<T>
Specified by:
create in class Bean<T>
Returns:
The instance

destroy

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

Specified by:
destroy in interface Contextual<T>
Specified by:
destroy in class Bean<T>
Parameters:
instance - The instance

callInitializers

protected void callInitializers(T instance)
Calls all initializers of the bean

Parameters:
instance - The bean instance

injectEjbAndCommonFields

protected void injectEjbAndCommonFields()
Injects EJBs and common fields


injectBoundFields

protected void injectBoundFields(T instance,
                                 Manager manager)
Injects bound fields

Parameters:
instance - The bean instance
manager - The Web Beans manager

getSpecializedType

protected AbstractBean<? extends T,java.lang.Class<T>> getSpecializedType()
Gets the specializes type of the bean

Overrides:
getSpecializedType in class AbstractBean<T,java.lang.Class<T>>
Returns:
The specialized type

getRemoveMethod

public AnnotatedMethod<?> getRemoveMethod()

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(java.lang.Object target)


Copyright © 2008. All Rights Reserved.