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
alternative, beanManager, name, qualifiers, scope, 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
protected static java.lang.String createId(java.lang.String beanType, InternalEjbDescriptor<?> ejbDescriptor)
           
protected  T createInstance(javax.enterprise.context.spi.CreationalContext<T> ctx)
           
 org.jboss.weld.ejb.api.SessionObjectReference createReference()
           
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
           
 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 initTypes()
           
 boolean isClientCanCallRemoveMethods()
           
protected  boolean isInterceptionCandidate()
           
 boolean isPassivationCapableBean()
           
 boolean isPassivationCapableDependency()
           
static
<T> SessionBean<T>
of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager)
          Creates a simple, annotation defined Enterprise Web Bean
protected  void preSpecialize(BeanDeployerEnvironment environment)
          Validates specialization
protected  void registerInterceptors()
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 
Methods inherited from class org.jboss.weld.bean.AbstractClassBean
applyDecorators, checkBeanImplementation, checkConstructor, checkType, defaultPostConstruct, defaultPreDestroy, flattenInterceptorBindings, getConstructor, getDecorators, getDefaultName, getInitializerMethods, getInjectableFields, getInjectionPoints, getInjectionTarget, getPostConstruct, getPreDestroy, getWeldAnnotated, hasCdiBoundInterceptors, hasDecorators, hasDirectlyDefinedInterceptors, initCdiBoundInterceptors, initConstructor, initDecorators, initDirectlyDefinedInterceptors, initializeAfterBeanDiscovery, initInitializerMethods, initInjectableFields, initPostConstruct, initPreDestroy, initProxyClassForDecoratedBean, initScope, initType, setInjectionTarget
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, getDelegateInjectionPoints, getMergedStereotypes, getName, getNewInjectionPoints, getQualifiers, getScope, getType, getTypedTypes, getTypes, getWeldInjectionPoints, initAlternative, initDefaultQualifiers, initName, initQualifiers, initScopeFromStereotype, initStereotypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getBeanManager, getId, hashCode, isProxyRequired, 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 beanManager)
Creates a simple, annotation defined Enterprise Web Bean

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

createId

protected static java.lang.String createId(java.lang.String beanType,
                                           InternalEjbDescriptor<?> ejbDescriptor)

initialize

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

Overrides:
initialize in class AbstractClassBean<T>

createInstance

protected T createInstance(javax.enterprise.context.spi.CreationalContext<T> ctx)

initTypes

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

isPassivationCapableBean

public boolean isPassivationCapableBean()
Specified by:
isPassivationCapableBean in class RIBean<T>

isPassivationCapableDependency

public boolean isPassivationCapableDependency()
Specified by:
isPassivationCapableDependency in class RIBean<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.


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>

registerInterceptors

protected void registerInterceptors()


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