org.jboss.weld.bean
Class SessionBean<T>

java.lang.Object
  extended by org.jboss.weld.bean.RIBean<T>
      extended by org.jboss.weld.bean.AbstractBean<T,java.lang.Class<T>>
          extended by org.jboss.weld.bean.AbstractClassBean<T>
              extended by org.jboss.weld.bean.SessionBean<T>
Type Parameters:
T - The type (class) of 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:
NewSessionBean

public class SessionBean<T>
extends AbstractClassBean<T>

An enterprise bean representation

Author:
Pete Muir

Field Summary
 
Fields inherited from class org.jboss.weld.bean.AbstractClassBean
annotatedItem
 
Fields inherited from class org.jboss.weld.bean.AbstractBean
bindings, manager, name, scopeType, type, types
 
Fields inherited from class org.jboss.weld.bean.RIBean
BEAN_ID_PREFIX, BEAN_ID_SEPARATOR
 
Constructor Summary
protected SessionBean(WeldClass<T> type, InternalEjbDescriptor<T> ejbDescriptor, java.lang.String idSuffix, BeanManagerImpl manager)
          Constructor
 
Method Summary
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(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Creates an instance of the bean
 org.jboss.weld.ejb.api.SessionObjectReference createReference()
           
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
           
 java.lang.String getDescription()
          Gets a string representation
 InternalEjbDescriptor<T> getEjbDescriptor()
           
 AbstractBean<?,?> getSpecializedBean()
           
 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  void initProxyClass()
           
protected  void initSerializable()
           
protected  void initTypes()
          Initializes the API types
 boolean isClientCanCallRemoveMethods()
           
protected  boolean isInterceptionCandidate()
           
 boolean isMethodExistsOnTypes(WeldMethod<?,?> method)
           
 boolean isSerializable()
           
static
<T> SessionBean<T>
of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl manager)
          Creates a simple, annotation defined Enterprise Web Bean
protected  void preSpecialize(BeanDeployerEnvironment environment)
          Validates specialization
protected  void specialize(BeanDeployerEnvironment environment)
           
 
Methods inherited from class org.jboss.weld.bean.AbstractClassBean
applyDecorators, checkBeanImplementation, checkType, defaultPostConstruct, defaultPreDestroy, flattenInterceptorBindings, getAnnotatedItem, getDecorators, getDefaultName, getInitializerMethods, getInjectableFields, getInjectionPoints, getInjectionTarget, getPostConstruct, getPreDestroy, getSuperclasses, hasDecorators, initDecorators, initInitializerMethods, initInjectableFields, initInterceptors, initPostConstruct, initPreDestroy, initProxyClassForDecoratedBean, initScopeType, initType, setInjectionTarget
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, getAnnotatedInjectionPoints, getDelegateInjectionPoints, getMergedStereotypes, getName, getQualifiers, getScope, getType, getTypes, initBindings, initDefaultBindings, initName, initPolicy, initPrimitive, initProxyable, initScopeTypeFromStereotype, initStereotypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getId, getManager, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SessionBean

protected SessionBean(WeldClass<T> type,
                      InternalEjbDescriptor<T> ejbDescriptor,
                      java.lang.String idSuffix,
                      BeanManagerImpl manager)
Constructor

Parameters:
type - The type of the bean
manager - The Bean manager
Method Detail

of

public static <T> SessionBean<T> of(InternalEjbDescriptor<T> ejbDescriptor,
                                    BeanManagerImpl 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

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


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(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates an instance of the bean

Returns:
The instance

destroy

public void destroy(T instance,
                    javax.enterprise.context.spi.CreationalContext<T> creationalContext)

getDescription

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

Specified by:
getDescription in class RIBean<T>
Returns:
The string representation

initSerializable

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

isSerializable

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

getEjbDescriptor

public InternalEjbDescriptor<T> getEjbDescriptor()

isClientCanCallRemoveMethods

public boolean isClientCanCallRemoveMethods()

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(WeldMethod<?,?> method)

createReference

public org.jboss.weld.ejb.api.SessionObjectReference createReference()

getStereotypes

public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
Specified by:
getStereotypes in interface javax.enterprise.inject.spi.Bean<T>
Overrides:
getStereotypes in class AbstractBean<T,java.lang.Class<T>>

isInterceptionCandidate

protected boolean isInterceptionCandidate()
Specified by:
isInterceptionCandidate in class AbstractClassBean<T>


Copyright © 2008-2009 Seam Framework. All Rights Reserved.