org.jboss.ejb3.stateful
Class StatefulContainer

java.lang.Object
  extended by org.jboss.ejb3.EJBContainer
      extended by org.jboss.ejb3.session.SessionContainer
          extended by org.jboss.ejb3.session.SessionSpecContainer
              extended by org.jboss.ejb3.stateful.StatefulContainer
All Implemented Interfaces:
org.jboss.ejb3.cache.StatefulObjectFactory<StatefulBeanContext>, Container, org.jboss.ejb3.endpoint.Endpoint, org.jboss.ejb3.endpoint.SessionFactory, org.jboss.ejb3.interceptors.direct.IndirectContainer<EJBContainer,org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer>>, JavaEEComponent, org.jboss.ejb3.proxy.spi.container.InvokableContext, org.jboss.ejb3.proxy.spi.container.StatefulSessionFactory, ExtendedInjectionContainer, InjectionContainer

public class StatefulContainer
extends SessionSpecContainer
implements org.jboss.ejb3.cache.StatefulObjectFactory<StatefulBeanContext>, org.jboss.ejb3.proxy.spi.container.StatefulSessionFactory, org.jboss.ejb3.endpoint.SessionFactory

Comment

Version:
$Revision: 87604 $
Author:
Bill Burke

Field Summary
protected  StatefulCache cache
           
 
Fields inherited from class org.jboss.ejb3.session.SessionSpecContainer
invokedMethod
 
Fields inherited from class org.jboss.ejb3.session.SessionContainer
proxyDeployer
 
Fields inherited from class org.jboss.ejb3.EJBContainer
assembly, beanClassName, classloader, defaultConstructorIndex, ejbName, enc, encFactory, encInjections, encInjectors, ENTITY_MANAGER_FACTORY, initialContextProperties, injectors, invokeStats, MANAGED_ENTITY_MANAGER_FACTORY, objectName, pool, reinitialize, xml
 
Fields inherited from interface org.jboss.ejb3.Container
ENC_CTX_NAME
 
Constructor Summary
StatefulContainer(ClassLoader cl, String beanClassName, String ejbName, org.jboss.aop.Domain domain, Hashtable ctxProperties, Ejb3Deployment deployment, org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData beanMetaData)
           
 
Method Summary
 StatefulBeanContext create(Class<?>[] initTypes, Object[] initValues)
           
protected  void createAndStartCache()
          Creates and starts the configured cache, if not started already
 BeanContext<?> createBeanContext()
          Create a bean context for use in a pool.
 Object createLocalProxy(Object id)
           
 Object createLocalProxy(Object id, org.jboss.ejb3.annotation.LocalBinding binding)
           
 Object createProxyLocalEjb21(Object id)
           
 Object createProxyLocalEjb21(Object id, org.jboss.ejb3.annotation.LocalBinding binding)
           
 Object createProxyRemoteEjb21(Object id)
           
 Object createProxyRemoteEjb21(Object id, org.jboss.ejb3.annotation.RemoteBinding binding)
           
 Object createRemoteProxy(Object id, org.jboss.ejb3.annotation.RemoteBinding binding)
           
 Serializable createSession(Class<?>[] initTypes, Object[] initValues)
          Create a stateful bean and return its oid.
 void destroy(StatefulBeanContext ctx)
           
protected  void destroySession(Object id)
          Deprecated. To be handled by SessionFactory.destroySession(Serializable)
 void destroySession(Serializable session)
          Destroys the specified session
 org.jboss.aop.joinpoint.InvocationResponse dynamicInvoke(org.jboss.aop.joinpoint.Invocation invocation)
          Remote Invocation entry point, as delegated from InvokableContextClassProxyHack (Remoting Dispatcher)
 Object getBusinessObject(BeanContext beanContext, Class businessInterface)
           
 StatefulCache getCache()
           
 CacheFactoryRegistry getCacheFactoryRegistry()
           
protected  Object[] getInitParameters(Method method, Class[] initParameterTypes, Object[] initParameterValues)
           
protected  String getJndiRegistrarBindName()
          Returns the name under which the JNDI Registrar for this container is bound
 Object getMBean()
           
 org.jboss.ejb3.endpoint.SessionFactory getSessionFactory()
          Returns the SessionFactory for this SFSB Container
 javax.ejb.TimerService getTimerService()
           
 javax.ejb.TimerService getTimerService(Object pKey)
          This method is called by EJBTimerServiceImpl to re-establish a persistent timer.
protected  org.jboss.aop.joinpoint.InvocationResponse invokeEJBObjectMethod(org.jboss.ejb3.common.lang.SerializableMethod method, org.jboss.ejb3.proxy.impl.invocation.StatefulRemoteInvocation statefulInvocation)
           
protected  Object invokeHomeCreate(Method method, Object[] args)
          Provides implementation for this bean's EJB 2.1 Home.create() method
protected  org.jboss.aop.joinpoint.InvocationResponse invokeHomeMethod(org.jboss.aop.MethodInfo info, org.jboss.ejb3.proxy.impl.invocation.StatefulRemoteInvocation statefulInvocation)
           
 void invokeInit(Object bean, Class[] initParameterTypes, Object[] initParameterValues)
           
 void invokePostActivate(BeanContext beanContext)
           
 void invokePrePassivate(BeanContext beanContext)
           
 boolean isClustered()
           
 boolean isSessionAware()
          Designates that this SFSB Container is session-aware.
 Object localHomeInvoke(Method method, Object[] args)
          Performs a synchronous or asynchronous local invocation
 Object localInvoke(Object id, Method method, Object[] args)
          Performs a synchronous or asynchronous local invocation
protected  void lockedStart()
          Lifecycle Start
protected  void lockedStop()
          Lifecycle Stop
protected  void popEnc()
          Pops EJB's ENC from the stack.
protected  void pushEnc()
          Makes sure that EJB's ENC is available Delegates to whatever implementation is used to push the ENC of the EJB onto the stack
protected  void removeHandle(javax.ejb.Handle arg)
           
 
Methods inherited from class org.jboss.ejb3.session.SessionSpecContainer
getInvokedBusinessInterface, invoke, invoke, invoke, isEJBObjectMethod, isEjbObjectMethod, isHandleMethod, isHandleMethod, isHomeMethod, isHomeMethod
 
Methods inherited from class org.jboss.ejb3.session.SessionContainer
constructProperNoSuchEjbException, createSession, getClusterFamilies, getJndiRegistrar, getMetaData, getProxyFactory, getProxyFactory, getProxyFactory, getRemoteBinding, getVirtualMethods, hasJNDIBinding, instantiated, invoke, invokeEJBObjectMethod, marshallException, marshallResponse, populateInvocation, registerWithAopDispatcher, resolveBusinessInterfaces, setJndiRegistrar
 
Methods inherited from class org.jboss.ejb3.EJBContainer
checkForDuplicateLocalAndRemoteInterfaces, construct, create, createInterceptor, createObjectName, createObjectName, destroy, destroyBeanContext, findPartitionName, getAdvisor, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotations, getAssemblyDescriptor, getBeanClass, getBeanClassName, getBeanContainer, getBusinessInterfaces, getCachedConnectionManager, getClassloader, getClazz, getDependencyPolicy, getDeployment, getDeploymentDescriptorType, getDeploymentPropertyListString, getDeploymentQualifiedName, getDeploymentUnit, getEJBContainer, getEjbJndiName, getEjbJndiName, getEjbName, getEnc, getEncInjections, getEncInjectors, getEnvironmentRefGroup, getHandledCallbacks, getIdentifier, getInitialContext, getInitialContextProperties, getInjectors, getInterceptorRepository, getInvocationLock, getInvokedBusinessInterface, getInvokedInterface, getInvokeStats, getJaccContextId, getMethodInfo, getModule, getName, getNonBridgeMethod, getObjectName, getPartitionName, getPool, getRootFile, getSecurityManager, getTimeoutCallback, getXml, initializePool, injectBeanContext, invokeCallback, invokePostConstruct, invokePostConstruct, invokePreDestroy, isAnnotationPresent, isBusinessMethod, peekContext, popContext, processMetadata, pushContext, reinitialize, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveEjbContainer, resolveEjbContainer, resolveInjectors, resolveMessageDestination, resolvePersistenceUnitSupplier, setAssemblyDescriptor, setCachedConnectionManager, setDirectContainer, setJaccContextId, setTransactionManager, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.ejb3.proxy.spi.container.StatefulSessionFactory
createSession
 

Field Detail

cache

protected StatefulCache cache
Constructor Detail

StatefulContainer

public StatefulContainer(ClassLoader cl,
                         String beanClassName,
                         String ejbName,
                         org.jboss.aop.Domain domain,
                         Hashtable ctxProperties,
                         Ejb3Deployment deployment,
                         org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData beanMetaData)
                  throws ClassNotFoundException
Throws:
ClassNotFoundException
Method Detail

create

public StatefulBeanContext create(Class<?>[] initTypes,
                                  Object[] initValues)
Specified by:
create in interface org.jboss.ejb3.cache.StatefulObjectFactory<StatefulBeanContext>

createBeanContext

public BeanContext<?> createBeanContext()
Description copied from interface: Container
Create a bean context for use in a pool.

Specified by:
createBeanContext in interface Container
Specified by:
createBeanContext in class EJBContainer
Returns:
a ready to use bean context

createProxyLocalEjb21

public Object createProxyLocalEjb21(Object id,
                                    org.jboss.ejb3.annotation.LocalBinding binding)
                             throws Exception
Throws:
Exception

createProxyRemoteEjb21

public Object createProxyRemoteEjb21(Object id)
                              throws Exception
Throws:
Exception

createProxyRemoteEjb21

public Object createProxyRemoteEjb21(Object id,
                                     org.jboss.ejb3.annotation.RemoteBinding binding)
                              throws Exception
Throws:
Exception

createProxyLocalEjb21

public Object createProxyLocalEjb21(Object id)
                             throws Exception
Throws:
Exception

destroy

public void destroy(StatefulBeanContext ctx)
Specified by:
destroy in interface org.jboss.ejb3.cache.StatefulObjectFactory<StatefulBeanContext>

getMBean

public Object getMBean()
Specified by:
getMBean in interface Container

createAndStartCache

protected void createAndStartCache()
                            throws Exception
Creates and starts the configured cache, if not started already

Throws:
Exception

lockedStart

protected void lockedStart()
                    throws Exception
Description copied from class: SessionSpecContainer
Lifecycle Start

Overrides:
lockedStart in class SessionSpecContainer
Throws:
Exception

lockedStop

protected void lockedStop()
                   throws Exception
Description copied from class: SessionSpecContainer
Lifecycle Stop

Overrides:
lockedStop in class SessionSpecContainer
Throws:
Exception

getCache

public StatefulCache getCache()

getCacheFactoryRegistry

public CacheFactoryRegistry getCacheFactoryRegistry()

getJndiRegistrarBindName

protected String getJndiRegistrarBindName()
Returns the name under which the JNDI Registrar for this container is bound

Specified by:
getJndiRegistrarBindName in class SessionContainer
Returns:

localHomeInvoke

public Object localHomeInvoke(Method method,
                              Object[] args)
                       throws Throwable
Performs a synchronous or asynchronous local invocation

Specified by:
localHomeInvoke in class SessionContainer
Throws:
Throwable

localInvoke

public Object localInvoke(Object id,
                          Method method,
                          Object[] args)
                   throws Throwable
Performs a synchronous or asynchronous local invocation

Specified by:
localInvoke in class SessionContainer
Parameters:
provider - If null a synchronous invocation, otherwise an asynchronous
Throws:
Throwable

createSession

public Serializable createSession(Class<?>[] initTypes,
                                  Object[] initValues)
Create a stateful bean and return its oid.

Specified by:
createSession in interface org.jboss.ejb3.endpoint.SessionFactory
Specified by:
createSession in class SessionContainer
Parameters:
initTypes - the parameter types used by the home's create method
initValues - the arguments for the home's create method
Returns:

destroySession

@Deprecated
protected void destroySession(Object id)
Deprecated. To be handled by SessionFactory.destroySession(Serializable)

Description copied from class: SessionContainer
Destroy a created session.

Overrides:
destroySession in class SessionContainer
Parameters:
id - the identifier of the session

dynamicInvoke

public org.jboss.aop.joinpoint.InvocationResponse dynamicInvoke(org.jboss.aop.joinpoint.Invocation invocation)
                                                         throws Throwable
Remote Invocation entry point, as delegated from InvokableContextClassProxyHack (Remoting Dispatcher)

Specified by:
dynamicInvoke in interface org.jboss.ejb3.proxy.spi.container.InvokableContext
Specified by:
dynamicInvoke in class SessionContainer
Throws:
Throwable

getTimerService

public javax.ejb.TimerService getTimerService()
Specified by:
getTimerService in interface Container

getTimerService

public javax.ejb.TimerService getTimerService(Object pKey)
Description copied from interface: Container
This method is called by EJBTimerServiceImpl to re-establish a persistent timer.

Specified by:
getTimerService in interface Container

invokePostActivate

public void invokePostActivate(BeanContext beanContext)
Specified by:
invokePostActivate in interface Container
Overrides:
invokePostActivate in class EJBContainer

invokePrePassivate

public void invokePrePassivate(BeanContext beanContext)
Specified by:
invokePrePassivate in interface Container
Overrides:
invokePrePassivate in class EJBContainer

invokeInit

public void invokeInit(Object bean,
                       Class[] initParameterTypes,
                       Object[] initParameterValues)
Specified by:
invokeInit in interface Container
Overrides:
invokeInit in class EJBContainer

getInitParameters

protected Object[] getInitParameters(Method method,
                                     Class[] initParameterTypes,
                                     Object[] initParameterValues)

createLocalProxy

public Object createLocalProxy(Object id)
                        throws Exception
Throws:
Exception

createLocalProxy

public Object createLocalProxy(Object id,
                               org.jboss.ejb3.annotation.LocalBinding binding)
                        throws Exception
Throws:
Exception

createRemoteProxy

public Object createRemoteProxy(Object id,
                                org.jboss.ejb3.annotation.RemoteBinding binding)
                         throws Exception
Throws:
Exception

isClustered

public boolean isClustered()
Specified by:
isClustered in interface Container
Overrides:
isClustered in class EJBContainer

invokeHomeCreate

protected Object invokeHomeCreate(Method method,
                                  Object[] args)
                           throws Exception
Description copied from class: SessionSpecContainer
Provides implementation for this bean's EJB 2.1 Home.create() method

Overrides:
invokeHomeCreate in class SessionSpecContainer
Returns:
Throws:
Exception

invokeHomeMethod

protected org.jboss.aop.joinpoint.InvocationResponse invokeHomeMethod(org.jboss.aop.MethodInfo info,
                                                                      org.jboss.ejb3.proxy.impl.invocation.StatefulRemoteInvocation statefulInvocation)
                                                               throws Throwable
Throws:
Throwable

invokeEJBObjectMethod

protected org.jboss.aop.joinpoint.InvocationResponse invokeEJBObjectMethod(org.jboss.ejb3.common.lang.SerializableMethod method,
                                                                           org.jboss.ejb3.proxy.impl.invocation.StatefulRemoteInvocation statefulInvocation)
                                                                    throws Throwable
Throws:
Throwable

getBusinessObject

public Object getBusinessObject(BeanContext beanContext,
                                Class businessInterface)
                         throws IllegalStateException
Overrides:
getBusinessObject in class EJBContainer
Throws:
IllegalStateException

popEnc

protected void popEnc()
Description copied from class: EJBContainer
Pops EJB's ENC from the stack. Delegates to whatever implementation is used to pop the EJB's ENC from the stock

Overrides:
popEnc in class EJBContainer

pushEnc

protected void pushEnc()
Description copied from class: EJBContainer
Makes sure that EJB's ENC is available Delegates to whatever implementation is used to push the ENC of the EJB onto the stack

Overrides:
pushEnc in class EJBContainer

removeHandle

protected void removeHandle(javax.ejb.Handle arg)
                     throws Exception
Specified by:
removeHandle in class SessionContainer
Throws:
Exception

getSessionFactory

public org.jboss.ejb3.endpoint.SessionFactory getSessionFactory()
                                                         throws IllegalStateException
Returns the SessionFactory for this SFSB Container

Specified by:
getSessionFactory in interface org.jboss.ejb3.endpoint.Endpoint
Overrides:
getSessionFactory in class SessionContainer
Throws:
IllegalStateException - If this Container is not session-aware
See Also:
Endpoint.getSessionFactory()

isSessionAware

public boolean isSessionAware()
Designates that this SFSB Container is session-aware.

Specified by:
isSessionAware in interface org.jboss.ejb3.endpoint.Endpoint
Overrides:
isSessionAware in class SessionContainer
See Also:
Endpoint.isSessionAware()

destroySession

public void destroySession(Serializable session)
Destroys the specified session

Specified by:
destroySession in interface org.jboss.ejb3.endpoint.SessionFactory
See Also:
SessionFactory.destroySession(java.io.Serializable)


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.