org.jboss.ejb3.stateful
Class StatefulContainer

java.lang.Object
  extended by org.jboss.ejb3.EJBContainer
      extended by org.jboss.ejb3.TimerServiceContainer
          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.async.spi.AsyncCancellableContext, org.jboss.ejb3.async.spi.AsyncEndpoint, org.jboss.ejb3.cache.StatefulObjectFactory<StatefulBeanContext>, Container, org.jboss.ejb3.context.spi.BeanManager, org.jboss.ejb3.context.spi.SessionBeanManager, 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, EJBInjectionContainer, 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


Field Summary
protected  StatefulCache cache
           
 
Fields inherited from class org.jboss.ejb3.session.SessionContainer
proxyDeployer
 
Fields inherited from class org.jboss.ejb3.TimerServiceContainer
timerService
 
Fields inherited from class org.jboss.ejb3.EJBContainer
assembly, beanClassName, classloader, ejbName, enc, encFactory, encInjections, encInjectors, ENTITY_MANAGER_FACTORY, initialContextProperties, injectors, invokeStats, MANAGED_ENTITY_MANAGER_FACTORY, metadataBasedAnnotationRepo, objectName, pool, reinitialize, xml
 
Fields inherited from interface org.jboss.ejb3.Container
ENC_CTX_NAME
 
Constructor Summary
StatefulContainer(java.lang.ClassLoader cl, java.lang.String beanClassName, java.lang.String ejbName, org.jboss.aop.Domain domain, java.util.Hashtable ctxProperties, Ejb3Deployment deployment, org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData beanMetaData, java.util.concurrent.ExecutorService asynchronousExecutor)
           
 
Method Summary
 StatefulBeanContext create(java.lang.Class<?>[] initTypes, java.lang.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.
 java.lang.Object createLocalProxy(java.lang.Object id)
           
 java.lang.Object createLocalProxy(java.lang.Object id, org.jboss.ejb3.annotation.LocalBinding binding)
           
 java.lang.Object createProxyLocalEjb21(java.lang.Object id)
           
 java.lang.Object createProxyLocalEjb21(java.lang.Object id, org.jboss.ejb3.annotation.LocalBinding binding)
           
 java.lang.Object createProxyRemoteEjb21(java.lang.Object id)
           
 java.lang.Object createProxyRemoteEjb21(java.lang.Object id, org.jboss.ejb3.annotation.RemoteBinding binding)
           
 java.lang.Object createRemoteProxy(java.lang.Object id, org.jboss.ejb3.annotation.RemoteBinding binding)
           
 java.io.Serializable createSession(java.lang.Class<?>[] initTypes, java.lang.Object[] initValues)
          Create a stateful bean and return its oid.
 void destroy(StatefulBeanContext ctx)
           
protected  void destroySession(java.lang.Object id)
          Deprecated. To be handled by SessionFactory.destroySession(Serializable)
 void destroySession(java.io.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)
 java.lang.Object getBusinessObject(BeanContext beanContext, java.lang.Class businessInterface)
           
 StatefulCache getCache()
           
 CacheFactoryRegistry getCacheFactoryRegistry()
           
 org.jboss.ejb3.effigy.SessionBeanEffigy getEffigy()
           
 java.lang.String getJndiRegistrarBindName()
          Returns the name under which the JNDI Registrar for this container is bound
 java.lang.Object getMBean()
           
 org.jboss.ejb3.endpoint.SessionFactory getSessionFactory()
          Returns the SessionFactory for this SFSB Container
protected  org.jboss.ejb3.timerservice.spi.TimedObjectInvoker getTimedObjectInvoker()
          Returns the TimedObjectInvoker which will be used by the timer implementations to invoke the timeout method (annotated with Timeout or specified in deployment descriptor) on the bean.
protected  org.jboss.aop.joinpoint.InvocationResponse invokeEJBObjectMethod(org.jboss.ejb3.common.lang.SerializableMethod method, org.jboss.ejb3.proxy.impl.invocation.StatefulRemoteInvocation statefulInvocation)
           
protected  java.lang.Object invokeHomeCreate(java.lang.reflect.Method method, java.lang.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 invokePostActivate(BeanContext beanContext)
           
 void invokePrePassivate(BeanContext beanContext)
           
 boolean isClustered()
           
 boolean isSessionAware()
          Designates that this SFSB Container is session-aware.
 java.lang.Object localHomeInvoke(java.lang.reflect.Method method, java.lang.Object[] args)
          Performs a synchronous or asynchronous local invocation
 java.lang.Object localInvoke(java.lang.Object id, java.lang.reflect.Method method, java.lang.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)
           
protected  void verifyBusinessObjectFactory()
           
 
Methods inherited from class org.jboss.ejb3.session.SessionSpecContainer
cancel, getAsynchronousExecutor, getBusinessInterfaces, getBusinessObjectFactory, getCurrentAsyncInvocations, invoke, invoke, invoke, invokeAsync, isEJBObjectMethod, isEjbObjectMethod, isHandleMethod, isHandleMethod, isHomeMethod, isHomeMethod, setBusinessObjectFactory, setCurrentAsyncInvocations
 
Methods inherited from class org.jboss.ejb3.session.SessionContainer
constructProperNoSuchEjbException, createSession, getBusinessObject, getClusterFamilies, getEJBLocalObject, getEJBObject, getJndiRegistrar, getMetaData, getProxyFactory, getProxyFactory, getProxyFactory, getRemoteBinding, getVirtualMethods, hasJNDIBinding, instantiated, invoke, invokeEJBObjectMethod, invokeSetSessionContext, marshallException, marshallResponse, populateInvocation, registerWithAopDispatcher, resolveBusinessInterfaces, setJndiRegistrar
 
Methods inherited from class org.jboss.ejb3.TimerServiceContainer
afterStart, create, getTimerService, getTimerService, setTimerServiceFactory
 
Methods inherited from class org.jboss.ejb3.EJBContainer
canResolveEJB, checkForDuplicateLocalAndRemoteInterfaces, construct, createInterceptor, createObjectName, createObjectName, destroy, destroyBeanContext, findPartitionName, getAdvisor, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotations, getApplicationException, getAssemblyDescriptor, getBeanClass, getBeanClassName, getBeanContainer, getBeanInstantiator, getBusinessAndComponentInterfaces, getCachedConnectionManager, getClassloader, getClazz, getDependencyPolicy, getDeployment, getDeploymentDescriptorType, getDeploymentPropertyListString, getDeploymentQualifiedName, getDeploymentUnit, getEJBContainer, getEJBHome, getEjbJndiName, getEjbJndiName, getEJBLocalHome, getEjbName, getEnc, getEncInjections, getEncInjectors, getEnvironmentRefGroup, getHandledCallbacks, getIdentifier, getInitialContext, getInitialContextProperties, getInjectionHandlers, getInjectors, getInterceptorClasses, getInterceptorInjectors, getInterceptorRepository, getInterceptors, getInvocationLock, getInvokedBusinessInterface, getInvokedInterface, getInvokeStats, getJaccContextId, getMetaDataBasedAnnotationRepository, getMethodInfo, getModule, getName, getNonBridgeMethod, getObjectName, getPartitionName, getPool, getRollbackOnly, getRootFile, getSecurityManager, getTimeoutCallback, getUserTransaction, getXml, initializePool, initMetaDataBasedAnnotationRepository, injectBeanContext, invokeCallback, invokePostConstruct, invokePostConstruct, invokePreDestroy, isAnnotationPresent, isBusinessMethod, isCallerInRole, lookup, peekContext, popContext, processMetadata, pushContext, reinitialize, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveEJB, resolveEjbContainer, resolveEjbContainer, resolveInjectors, resolveMessageDestination, resolvePersistenceUnitSupplier, setAssemblyDescriptor, setBeanInstantiator, setCachedConnectionManager, setDirectContainer, setEjbEncFactory, setInjectionManager, setJaccContextId, setRollbackOnly, 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
 
Methods inherited from interface org.jboss.ejb3.context.spi.BeanManager
getEJBHome, getEJBLocalHome, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, lookup, setRollbackOnly
 

Field Detail

cache

protected StatefulCache cache
Constructor Detail

StatefulContainer

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

create

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

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 java.lang.Object createProxyLocalEjb21(java.lang.Object id,
                                              org.jboss.ejb3.annotation.LocalBinding binding)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

createProxyRemoteEjb21

public java.lang.Object createProxyRemoteEjb21(java.lang.Object id)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

createProxyRemoteEjb21

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

createProxyLocalEjb21

public java.lang.Object createProxyLocalEjb21(java.lang.Object id)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

destroy

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

getEffigy

public org.jboss.ejb3.effigy.SessionBeanEffigy getEffigy()
Overrides:
getEffigy in class EJBContainer

getMBean

public java.lang.Object getMBean()
Specified by:
getMBean in interface Container

createAndStartCache

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

Throws:
java.lang.Exception

lockedStart

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

Overrides:
lockedStart in class SessionSpecContainer
Throws:
java.lang.Exception

lockedStop

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

Overrides:
lockedStop in class SessionSpecContainer
Throws:
java.lang.Exception
See Also:
EJBContainer.lockedStop()

getCache

public StatefulCache getCache()

getCacheFactoryRegistry

public CacheFactoryRegistry getCacheFactoryRegistry()

getJndiRegistrarBindName

public java.lang.String getJndiRegistrarBindName()
Returns the name under which the JNDI Registrar for this container is bound

Specified by:
getJndiRegistrarBindName in class SessionContainer
Returns:

localHomeInvoke

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

Specified by:
localHomeInvoke in class SessionContainer
Throws:
java.lang.Throwable

localInvoke

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

Specified by:
localInvoke in class SessionContainer
Throws:
java.lang.Throwable

createSession

public java.io.Serializable createSession(java.lang.Class<?>[] initTypes,
                                          java.lang.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(java.lang.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 java.lang.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:
java.lang.Throwable

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

createLocalProxy

public java.lang.Object createLocalProxy(java.lang.Object id)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

createLocalProxy

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

createRemoteProxy

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

isClustered

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

invokeHomeCreate

protected java.lang.Object invokeHomeCreate(java.lang.reflect.Method method,
                                            java.lang.Object[] args)
                                     throws java.lang.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:
java.lang.Exception

invokeHomeMethod

protected org.jboss.aop.joinpoint.InvocationResponse invokeHomeMethod(org.jboss.aop.MethodInfo info,
                                                                      org.jboss.ejb3.proxy.impl.invocation.StatefulRemoteInvocation statefulInvocation)
                                                               throws java.lang.Throwable
Throws:
java.lang.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 java.lang.Throwable
Throws:
java.lang.Throwable

getBusinessObject

public java.lang.Object getBusinessObject(BeanContext beanContext,
                                          java.lang.Class businessInterface)
                                   throws java.lang.IllegalStateException
Overrides:
getBusinessObject in class EJBContainer
Throws:
java.lang.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 java.lang.Exception
Specified by:
removeHandle in class SessionContainer
Throws:
java.lang.Exception

getSessionFactory

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

Specified by:
getSessionFactory in interface org.jboss.ejb3.endpoint.Endpoint
Overrides:
getSessionFactory in class SessionContainer
Throws:
java.lang.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(java.io.Serializable session)
Destroys the specified session

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

getTimedObjectInvoker

protected org.jboss.ejb3.timerservice.spi.TimedObjectInvoker getTimedObjectInvoker()
Description copied from class: TimerServiceContainer
Returns the TimedObjectInvoker which will be used by the timer implementations to invoke the timeout method (annotated with Timeout or specified in deployment descriptor) on the bean.

Specified by:
getTimedObjectInvoker in class TimerServiceContainer
Returns:

verifyBusinessObjectFactory

protected void verifyBusinessObjectFactory()
Overrides:
verifyBusinessObjectFactory in class SessionSpecContainer