com.sun.ejb.containers
Class StatelessSessionContainer

java.lang.Object
  extended by com.sun.ejb.containers.BaseContainer
      extended by com.sun.ejb.containers.StatelessSessionContainer
All Implemented Interfaces:
Container, JavaEEContainer, EjbContainerFacade
Direct Known Subclasses:
TimerBeanContainer

public class StatelessSessionContainer
extends BaseContainer

This class provides container functionality specific to stateless SessionBeans. At deployment time, one instance of the StatelessSessionContainer is created for each stateless SessionBean type (i.e. deployment descriptor) in a JAR.

The 3 states of a Stateless EJB (an EJB can be in only 1 state at a time): 1. POOLED : ready for invocations, no transaction in progress 2. INVOKING : processing an invocation 3. DESTROYED : does not exist

This container services invocations using a pool of EJB instances. An instance is returned to the pool immediately after the invocation completes, so the # of instances needed = # of concurrent invocations.

A Stateless Bean can hold open DB connections across invocations. Its assumed that the Resource Manager can handle multiple incomplete transactions on the same connection.


Nested Class Summary
protected  class StatelessSessionContainer.SessionContextFactory
           
 
Nested classes/interfaces inherited from class com.sun.ejb.containers.BaseContainer
BaseContainer.ContainerType
 
Field Summary
protected  AbstractPool pool
           
 
Fields inherited from class com.sun.ejb.containers.BaseContainer
_logger, cacheProbeListener, cacheProbeNotifier, callFlowInfo, cmtTimeoutInSeconds, componentId, CONTAINER_INITIALIZING, CONTAINER_ON_HOLD, CONTAINER_STARTED, CONTAINER_STOPPED, CONTAINER_UNDEPLOYED, containerInfo, containerState, containerType, debugMonitorFlag, ejbActivateMethod, ejbClass, ejbContainerUtilImpl, ejbDescriptor, ejbGeneratedOptionalLocalBusinessIntfClass, ejbHome, ejbHomeImpl, ejbHomeStub, ejbIntfMethodInfo, ejbIntfMethods, ejbLocalBusinessHome, ejbLocalBusinessHomeImpl, ejbLocalHome, ejbLocalHomeImpl, ejbMethodStatsManager, ejbOptionalLocalBusinessHome, ejbOptionalLocalBusinessHomeImpl, ejbOptionalLocalBusinessHomeIntf, ejbPassivateMethod, ejbProbeListener, ejbProbeNotifier, ejbRemoteBusinessHome, ejbRemoteBusinessHomeImpl, ejbRemoteBusinessHomeStub, ejbRemoveMethod, ejbTimeoutMethod, envProps, hasLocalBusinessView, hasLocalHomeView, hasOptionalLocalBusinessView, hasRemoteBusinessView, hasRemoteHomeView, homeIntf, injectionManager, interceptorManager, invocationInfoMap, invocationManager, isEntity, isLocal, isMessageDriven, isRemote, isSession, isSingleton, isStatefulSession, isStatelessSession, isWebServiceEndpoint, lifecycleCallbackAnnotationClasses, loader, localBusinessHomeIntf, localBusinessIntfs, localHomeIntf, logParams, metadata, methodMonitorMap, monitorOn, namingManager, NO_PARAMS, optIntfClassLoader, poolProbeListener, registryMediator, remoteBusinessHomeIntf, remoteBusinessIntfInfo, remoteHomeRefFactory, remoteIntf, scheduleIds, securityManager, sfsbSerializedClass, SINGLETON_BEAN_POOL_PROP, timerProbeListener, timerProbeNotifier, transactionManager, webServiceEndpointIntf, webServiceInvocationInfoMap
 
Fields inherited from interface com.sun.ejb.Container
SEC_CHECKED, SEC_EXCLUDED, SEC_NOT_INITIALIZED, SEC_UNCHECKED, secAttrStrings, TX_BEAN_MANAGED, TX_MANDATORY, TX_NEVER, TX_NOT_INITIALIZED, TX_NOT_SUPPORTED, TX_REQUIRED, TX_REQUIRES_NEW, TX_SUPPORTS, txAttrStrings
 
Constructor Summary
protected StatelessSessionContainer(BaseContainer.ContainerType conType, EjbDescriptor desc, java.lang.ClassLoader loader)
           
 
Method Summary
protected  EJBContextImpl _constructEJBContextImpl(java.lang.Object instance)
           
protected  ComponentContext _getContext(EjbInvocation inv)
          Called from preInvoke which is called from the EJBObject for local and remote invocations.
 void activateEJB(java.lang.Object ctx, java.lang.Object instanceKey)
           
protected  void createBeanPool()
           
 EJBLocalObjectImpl createEJBLocalBusinessObjectImpl(boolean localBeanView)
          Called during internal creation of session bean
 EJBLocalObjectImpl createEJBLocalObjectImpl()
          Called during client creation request through EJB LocalHome view.
 EJBObjectImpl createEJBObjectImpl()
           
 EJBObjectImpl createRemoteBusinessObjectImpl()
           
protected  void doConcreteContainerShutdown(boolean appBeingUndeployed)
          TODO ??? public void appendStats(StringBuffer sbuf) { sbuf.append("\nStatelessContainer: ") .append("CreateCount=").append(statCreateCount).append("; ") .append("RemoveCount=").append(statRemoveCount).append("; ") .append("]"); }
 int getMaxPoolSize()
           
 long getMethodReadyCount()
           
 java.lang.String getMonitorAttributeValues()
           
protected  EjbMonitoringStatsProvider getMonitoringStatsProvider(java.lang.String appName, java.lang.String modName, java.lang.String ejbName)
           
 int getSteadyPoolSize()
           
protected  void initializeHome()
          Called from the ContainerFactory during initialization.
 void onReady()
          Called when server instance is Ready
 boolean passivateEJB(ComponentContext context)
           
protected  void registerMonitorableComponents()
           
 void releaseContext(EjbInvocation inv)
          Called from preInvoke which is called from the EJBObject for local and remote invocations.
 boolean userTransactionMethodsAllowed(ComponentInvocation inv)
          EJB spec makes a distinction between access to the UserTransaction object itself and access to its methods.
 
Methods inherited from class com.sun.ejb.containers.BaseContainer
_constructEJBInstance, addSchedule, assertValidLocalObject, assertValidRemoteObject, authorize, checkExceptionClientTx, checkUnfinishedTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createMonitoringRegistryMediator, createRemoteReferenceWithId, doAfterBegin, doEJBHomeRemove, doFlush, enlistExtendedEntityManagers, externalPostInvoke, externalPreInvoke, findFlushEnabledAttr, findTxAttr, getClassLoader, getComponentId, getContainerClassLoader, getContainerType, getContext, getDebugMonitorFlag, getDescriptor, getEJBClass, getEjbDescriptor, getEJBHome, getEJBHomeStub, getEJBLocalBusinessHome, getEJBLocalHome, getEJBLocalObjectForPrimaryKey, getEJBLocalObjectForPrimaryKey, getEJBMetaData, getEJBObjectForPrimaryKey, getJaccEjb, getJavaGlobalJndiNamePrefix, getMonitoringMethodsArray, getMonitoringMethodsArray, getPre30LifecycleMethodNames, getProtocolManager, getSecurityManager, getTargetObject, getTxAttr, getTxAttr, incrementCreatedTimedObject, incrementDeliveredTimedObject, incrementRemovedTimedObject, injectEjbInstance, instantiateEJBLocalBusinessObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBObjectImpl, instantiateOptionalEJBLocalBusinessObjectImpl, instantiateRemoteBusinessObjectImpl, invokeBeanMethod, isAppExceptionRequiringRollback, isApplicationException, isHAEnabled, isLocalInterfaceSupported, isRemoteInterfaceSupported, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, lookupExtendedEntityManager, onShutdown, onTermination, populateMethodMonitorMap, populateMethodMonitorMap, populateMethodMonitorMap, postCreate, postFind, postInvoke, postInvoke, postInvokeTx, postProcessInvocationInfo, preInitialize, preInvoke, preInvokeTx, preSelect, registerTimerMonitorableComponent, registerTxAttrForMethod, releaseTargetObject, removeBeanUnchecked, removeBeanUnchecked, setDebugMonitorFlag, setMonitorOn, setSecurityManager, setStartedState, setStoppedState, setUndeployedState, startApplication, toString, undeploy, useClientTx, webServicePostInvoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pool

protected AbstractPool pool
Constructor Detail

StatelessSessionContainer

protected StatelessSessionContainer(BaseContainer.ContainerType conType,
                                    EjbDescriptor desc,
                                    java.lang.ClassLoader loader)
                             throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getMonitorAttributeValues

public java.lang.String getMonitorAttributeValues()

getMonitoringStatsProvider

protected EjbMonitoringStatsProvider getMonitoringStatsProvider(java.lang.String appName,
                                                                java.lang.String modName,
                                                                java.lang.String ejbName)
Specified by:
getMonitoringStatsProvider in class BaseContainer

initializeHome

protected void initializeHome()
                       throws java.lang.Exception
Description copied from class: BaseContainer
Called from the ContainerFactory during initialization.

Throws:
java.lang.Exception

createBeanPool

protected void createBeanPool()

registerMonitorableComponents

protected void registerMonitorableComponents()
Overrides:
registerMonitorableComponents in class BaseContainer

onReady

public void onReady()
Description copied from class: BaseContainer
Called when server instance is Ready

Specified by:
onReady in interface Container
Overrides:
onReady in class BaseContainer

createRemoteBusinessObjectImpl

public EJBObjectImpl createRemoteBusinessObjectImpl()
                                             throws CreateException,
                                                    java.rmi.RemoteException
Throws:
CreateException
java.rmi.RemoteException

createEJBObjectImpl

public EJBObjectImpl createEJBObjectImpl()
                                  throws CreateException,
                                         java.rmi.RemoteException
Throws:
CreateException
java.rmi.RemoteException

createEJBLocalObjectImpl

public EJBLocalObjectImpl createEJBLocalObjectImpl()
                                            throws CreateException
Called during client creation request through EJB LocalHome view.

Throws:
CreateException

createEJBLocalBusinessObjectImpl

public EJBLocalObjectImpl createEJBLocalBusinessObjectImpl(boolean localBeanView)
                                                    throws CreateException
Called during internal creation of session bean

Throws:
CreateException

_getContext

protected ComponentContext _getContext(EjbInvocation inv)
Called from preInvoke which is called from the EJBObject for local and remote invocations.

Specified by:
_getContext in class BaseContainer

_constructEJBContextImpl

protected EJBContextImpl _constructEJBContextImpl(java.lang.Object instance)
Overrides:
_constructEJBContextImpl in class BaseContainer

userTransactionMethodsAllowed

public boolean userTransactionMethodsAllowed(ComponentInvocation inv)
Description copied from class: BaseContainer
EJB spec makes a distinction between access to the UserTransaction object itself and access to its methods. getUserTransaction covers the first check and this method covers the second. It is called by the UserTransaction implementation to verify access.

Specified by:
userTransactionMethodsAllowed in interface Container
Overrides:
userTransactionMethodsAllowed in class BaseContainer

releaseContext

public void releaseContext(EjbInvocation inv)
Called from preInvoke which is called from the EJBObject for local and remote invocations.

Specified by:
releaseContext in class BaseContainer

passivateEJB

public boolean passivateEJB(ComponentContext context)

activateEJB

public void activateEJB(java.lang.Object ctx,
                        java.lang.Object instanceKey)

doConcreteContainerShutdown

protected void doConcreteContainerShutdown(boolean appBeingUndeployed)
TODO ??? public void appendStats(StringBuffer sbuf) { sbuf.append("\nStatelessContainer: ") .append("CreateCount=").append(statCreateCount).append("; ") .append("RemoveCount=").append(statRemoveCount).append("; ") .append("]"); }

Specified by:
doConcreteContainerShutdown in class BaseContainer

getMethodReadyCount

public long getMethodReadyCount()

getMaxPoolSize

public int getMaxPoolSize()

getSteadyPoolSize

public int getSteadyPoolSize()


Copyright © 2012 GlassFish Community. All Rights Reserved.