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,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, Ales Justin

Field Summary
 
Fields inherited from class org.jboss.weld.bean.AbstractClassBean
annotatedItem, constructorForEnhancedSubclass, decoratorProxyFactory, enhancedSubclass
 
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, String idSuffix, BeanManagerImpl manager, org.jboss.weld.bootstrap.api.ServiceRegistry services)
          Constructor
 
Method Summary
protected  T applyDecorators(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext, javax.enterprise.inject.spi.InjectionPoint originalInjectionPoint)
           
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
protected  void checkType()
           
 T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Creates an instance of the bean
protected static String createId(String beanType, InternalEjbDescriptor<?> ejbDescriptor)
           
protected static String createId(String beanType, InternalEjbDescriptor<?> ejbDescriptor, WeldClass<?> type)
           
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()
           
 boolean hasDefaultProducer()
          Returns true if the bean uses the default Producer ( or InjectionTarget).
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
 void initializeAfterBeanDiscovery()
          In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g.
protected  void initProxyClass()
           
protected  void initTypes()
           
 boolean isClientCanCallRemoveMethods()
           
protected  boolean isInterceptionCandidate()
           
 boolean isPassivationCapableBean()
           
 boolean isPassivationCapableDependency()
           
 boolean isProxyable()
           
static
<T> SessionBean<T>
of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager, org.jboss.weld.bootstrap.api.ServiceRegistry services)
          Creates a simple, annotation defined Enterprise Web Bean
static
<T> SessionBean<T>
of(InternalEjbDescriptor<T> ejbDescriptor, BeanManagerImpl beanManager, WeldClass<T> type, org.jboss.weld.bootstrap.api.ServiceRegistry services)
          Creates a simple, annotation defined Enterprise Web Bean using the annotations specified on type
protected  void preSpecialize(BeanDeployerEnvironment environment)
          Validates specialization
protected  void registerInterceptors()
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 String toString()
           
 
Methods inherited from class org.jboss.weld.bean.AbstractClassBean
checkBeanImplementation, checkConstructor, createEnhancedSubclass, defaultPostConstruct, defaultPreDestroy, getConstructor, getDecorators, getDefaultName, getInitializerMethods, getInjectableFields, getInjectionPoints, getInjectionTarget, getPostConstruct, getPreDestroy, getWeldAnnotated, hasDecorators, hasInterceptors, initConstructor, initDecorators, initEnhancedSubclass, initInitializerMethods, initInjectableFields, initInterceptorsIfNeeded, initPostConstruct, initPreDestroy, initScope, initType, isSubclassed, setInjectionTarget
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, cleanupAfterBoot, getDelegateInjectionPoints, getMergedStereotypes, getName, getNewInjectionPoints, getQualifiers, getScope, getServices, getStereotypes, getType, getTypedTypes, getTypes, getWeldInjectionPoints, initAlternative, initDefaultQualifiers, initName, initQualifiers, initScopeFromStereotype, initStereotypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyRequired, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getBeanManager, getId, getQualifierInstances, hashCode
 
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,
                      String idSuffix,
                      BeanManagerImpl manager,
                      org.jboss.weld.bootstrap.api.ServiceRegistry services)
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,
                                    org.jboss.weld.bootstrap.api.ServiceRegistry services)
Creates a simple, annotation defined Enterprise Web Bean

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

of

public static <T> SessionBean<T> of(InternalEjbDescriptor<T> ejbDescriptor,
                                    BeanManagerImpl beanManager,
                                    WeldClass<T> type,
                                    org.jboss.weld.bootstrap.api.ServiceRegistry services)
Creates a simple, annotation defined Enterprise Web Bean using the annotations specified on type

Type Parameters:
T - The type
Parameters:
beanManager - the current manager
type - the AnnotatedType to use
Returns:
An Enterprise Web Bean

createId

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

createId

protected static String createId(String beanType,
                                 InternalEjbDescriptor<?> ejbDescriptor,
                                 WeldClass<?> type)

initialize

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

Overrides:
initialize in class AbstractClassBean<T>

initializeAfterBeanDiscovery

public void initializeAfterBeanDiscovery()
Description copied from class: RIBean
In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g. for initializing decorators taking into account the possibility of having custom decorators which are deployed through portable extensions)

Overrides:
initializeAfterBeanDiscovery 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,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,Class<T>>

create

public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates an instance of the bean

Returns:
The instance

applyDecorators

protected T applyDecorators(T instance,
                            javax.enterprise.context.spi.CreationalContext<T> creationalContext,
                            javax.enterprise.inject.spi.InjectionPoint originalInjectionPoint)
Overrides:
applyDecorators in class AbstractClassBean<T>

destroy

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

checkType

protected void checkType()
Specified by:
checkType in class AbstractBean<T,Class<T>>

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,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()

isInterceptionCandidate

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

registerInterceptors

protected void registerInterceptors()

toString

public String toString()
Overrides:
toString in class RIBean<T>

isProxyable

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

hasDefaultProducer

public boolean hasDefaultProducer()
Description copied from class: AbstractBean
Returns true if the bean uses the default Producer ( or InjectionTarget). The method returns false if the producer of the bean was replaced by an extension.

Specified by:
hasDefaultProducer in class AbstractBean<T,Class<T>>


Copyright © 2013 Seam Framework. All Rights Reserved.