Package com.sun.ejb.containers
Class StatelessSessionContainer
java.lang.Object
com.sun.ejb.containers.BaseContainer
com.sun.ejb.containers.StatelessSessionContainer
- All Implemented Interfaces:
Container,com.sun.enterprise.container.common.spi.JavaEEContainer,org.glassfish.enterprise.iiop.spi.EjbContainerFacade
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):
- POOLED : ready for invocations, no transaction in progress
- INVOKING : processing an invocation
- DESTROYED : does not exist
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
Nested ClassesNested classes/interfaces inherited from class com.sun.ejb.containers.BaseContainer
BaseContainer.ContainerInfo, BaseContainer.ContainerType, BaseContainer.PreInvokeException -
Field Summary
FieldsFields inherited from class com.sun.ejb.containers.BaseContainer
_logger, cacheProbeListener, cacheProbeNotifier, callFlowInfo, componentId, CONTAINER_INITIALIZING, CONTAINER_ON_HOLD, CONTAINER_STARTED, CONTAINER_STOPPED, CONTAINER_UNDEPLOYED, containerInfo, containerState, containerStateManager, containerTransactionManager, debugMonitorFlag, ejbActivateMethod, ejbClass, ejbContainerUtilImpl, ejbDescriptor, ejbGeneratedOptionalLocalBusinessIntfClass, ejbHome, ejbHomeImpl, ejbHomeStub, ejbIntfMethodInfo, ejbIntfMethods, ejbLocalBusinessHome, ejbLocalBusinessHomeImpl, ejbLocalHome, ejbLocalHomeImpl, EJBLocalObject_getPrimaryKey, EJBObject_getPrimaryKey, ejbOptionalLocalBusinessHome, ejbOptionalLocalBusinessHomeImpl, ejbOptionalLocalBusinessHomeIntf, ejbPassivateMethod, ejbProbeListener, ejbProbeNotifier, ejbRemoteBusinessHome, ejbRemoteBusinessHomeImpl, ejbRemoteBusinessHomeStub, ejbRemoveMethod, envProps, hasLocalBusinessView, hasLocalHomeView, hasOptionalLocalBusinessView, hasRemoteBusinessView, hasRemoteHomeView, homeIntf, injectionManager, interceptorManager, invocationInfoMap, invocationManager, isBeanManagedTran, isLocal, isMessageDriven, isRemote, isSession, isSingleton, isStatefulSession, isStatelessSession, isWebServiceEndpoint, loader, localBusinessHomeIntf, localBusinessIntfs, localHomeIntf, metadata, methodMonitorMap, monitorOn, namingManager, NO_PARAMS, optIntfClassLoader, poolProbeListener, remoteBusinessHomeIntf, remoteBusinessIntfInfo, remoteHomeRefFactory, remoteIntf, scheduleIds, securityManager, sfsbSerializedClass, SINGLETON_BEAN_POOL_PROP, timerProbeListener, timerProbeNotifier, transactionManager, webServiceEndpointIntf, webServiceInvocationInfoMapFields 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
ConstructorsModifierConstructorDescriptionprotectedStatelessSessionContainer(BaseContainer.ContainerType conType, EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) -
Method Summary
Modifier and TypeMethodDescriptionprotected EJBContextImpl_constructEJBContextImpl(Object instance) protected ComponentContext_getContext(EjbInvocation inv) Called from preInvoke which is called from the EJBObject for local and remote invocations.voidactivateEJB(Object ctx, Object instanceKey) Doesn't do anything by default.protected voidafterBegin(EJBContextImpl context) protected voidafterCompletion(EJBContextImpl ctx, int status) protected voidbeforeCompletion(EJBContextImpl context) protected voidcheckExists(EJBLocalRemoteObject ejbObj) Check if the given EJBObject/LocalObject has been removed.protected voidcreateEJBLocalBusinessObjectImpl(boolean localBeanView) Called during internal creation of session beanCalled during client creation request through EJB LocalHome view.protected voiddoConcreteContainerShutdown(boolean appBeingUndeployed) protected voiddoTimerInvocationInit(EjbInvocation inv, Object primaryKey) This is implemented by concrete containers that support TimedObjects.protected voidForce destroy the EJB.protected EJBLocalObjectImplCalled from EJBLocalObjectImpl.getLocalObject() while deserializing a local object reference.protected EJBObjectImplgetEJBObjectImpl(byte[] instanceKey) Called when a remote invocation arrives for an EJB.intlongprotected EjbMonitoringStatsProvidergetMonitoringStatsProvider(String appName, String modName, String ejbName) intprotected voidCalled from the ContainerFactory during initialization.protected booleanisIdentical(EJBObjectImpl ejbo, jakarta.ejb.EJBObject other) voidonReady()Called when server instance is ReadybooleanpassivateEJB(ComponentContext context) protected voidvoidCalled from preInvoke which is called from the EJBObject for local and remote invocations.protected voidremoveBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) protected booleanbooleanprotected booleanbooleanuserTransactionMethodsAllowed(org.glassfish.api.invocation.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, addInvocationInfo, addLocalRemoteInvocationInfo, addProxyInterfacesSetClass, adjustHomeTargetMethodInfo, adjustInvocationInfo, assertValidLocalObject, assertValidRemoteObject, authorize, authorizeLocalGetPrimaryKey, authorizeLocalMethod, authorizeRemoteGetPrimaryKey, authorizeRemoteMethod, callEJBTimeout, cancelTimers, checkExceptionClientTx, checkUnfinishedTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createEjbInstanceForInterceptors, createEjbInvocation, createEjbInvocation, createMonitoringRegistry, createRemoteReferenceWithId, delistExtendedEntityManagers, doAfterBegin, doEJBHomeRemove, doFlush, enlistExtendedEntityManagers, externalPostInvoke, externalPreInvoke, findFlushEnabledAttr, getApplicationId, getClassLoader, getComponentId, getContainerClassLoader, getContainerId, getContainerInfo, getContext, getDebugMonitorFlag, getDescriptor, getEJBClass, getEjbDescriptor, getEJBHome, getEJBHomeInvocationHandler, getEJBHomeStub, getEJBLocalBusinessHome, getEJBLocalHome, getEJBLocalHomeInvocationHandler, getEJBLocalObjectForPrimaryKey, getEJBLocalObjectForPrimaryKey, getEJBMetaData, getEJBObjectForPrimaryKey, getInvocationKey, getJaccEjb, getJavaGlobalJndiNamePrefix, getMonitoringMethodsArray, getMonitoringMethodsArray, getPassByReference, getPre30LifecycleMethodNames, getProtocolManager, getSecurityManager, getTargetObject, getTimeoutMethod, getTxAttr, getTxAttr, getTxAttrForLifecycleCallback, getUserTransaction, getUseThreadPoolId, incrementCreatedTimedObject, incrementDeliveredTimedObject, incrementRemovedTimedObject, initializeProtocolManager, injectEjbInstance, instantiateEJBLocalBusinessObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBObjectImpl, instantiateEJBObjectImpl, instantiateOptionalEJBLocalBusinessObjectImpl, instantiateRemoteBusinessObjectImpl, intercept, intercept, invokeBeanMethod, invokeFindByPrimaryKey, invokeTargetBeanMethod, isApplicationException, isCreateHomeFinder, isEjbTimeoutMethod, isHAEnabled, isLocalInterfaceSupported, isLocalObject, isRemoteInterfaceSupported, isRemoteObject, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, lookupExtendedEntityManager, onEnteringContainer, onLeavingContainer, onShutdown, onTermination, postCreate, postEjbTimeout, postFind, postInvoke, postInvoke, postInvokeNoTx, postInvokeTx, postProcessInvocationInfo, preInitialize, preInvoke, preInvokeNoTx, preInvokeTx, prepareEjbTimeoutParams, preSelect, registerSystemInterceptor, registerTimerMonitorableComponent, releaseTargetObject, removeBeanUnchecked, removeBeanUnchecked, setDebugMonitorFlag, setEJBMetaData, setStartedState, setStoppedState, setUndeployedState, startApplication, toString, undeploy, useClientTx, validateEMForClientTx, validateTxAttr, webServicePostInvoke
-
Field Details
-
pool
-
-
Constructor Details
-
StatelessSessionContainer
protected StatelessSessionContainer(BaseContainer.ContainerType conType, EjbDescriptor desc, ClassLoader loader, com.sun.enterprise.security.SecurityManager sm) throws Exception - Throws:
Exception
-
-
Method Details
-
getMonitorAttributeValues
-
suspendTransaction
- Overrides:
suspendTransactionin classBaseContainer- Throws:
Exception
-
resumeTransaction
- Overrides:
resumeTransactionin classBaseContainer- Throws:
Exception
-
scanForEjbCreateMethod
public boolean scanForEjbCreateMethod()- Overrides:
scanForEjbCreateMethodin classBaseContainer
-
getMonitoringStatsProvider
protected EjbMonitoringStatsProvider getMonitoringStatsProvider(String appName, String modName, String ejbName) - Specified by:
getMonitoringStatsProviderin classBaseContainer
-
initializeHome
Description copied from class:BaseContainerCalled from the ContainerFactory during initialization.- Overrides:
initializeHomein classBaseContainer- Throws:
Exception
-
createBeanPool
protected void createBeanPool() -
registerMonitorableComponents
protected void registerMonitorableComponents()- Overrides:
registerMonitorableComponentsin classBaseContainer
-
onReady
public void onReady()Description copied from class:BaseContainerCalled when server instance is Ready- Specified by:
onReadyin interfaceContainer- Overrides:
onReadyin classBaseContainer
-
createRemoteBusinessObjectImpl
public EJBObjectImpl createRemoteBusinessObjectImpl() throws jakarta.ejb.CreateException, RemoteException- Throws:
jakarta.ejb.CreateExceptionRemoteException
-
createEJBObjectImpl
- Specified by:
createEJBObjectImplin classBaseContainer- Throws:
jakarta.ejb.CreateExceptionRemoteException
-
createEJBLocalObjectImpl
Called during client creation request through EJB LocalHome view.- Overrides:
createEJBLocalObjectImplin classBaseContainer- Throws:
jakarta.ejb.CreateException
-
createEJBLocalBusinessObjectImpl
public EJBLocalObjectImpl createEJBLocalBusinessObjectImpl(boolean localBeanView) throws jakarta.ejb.CreateException Called during internal creation of session bean- Throws:
jakarta.ejb.CreateException
-
removeBean
protected void removeBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws jakarta.ejb.RemoveException, jakarta.ejb.EJBException, RemoteException - Specified by:
removeBeanin classBaseContainer- Throws:
jakarta.ejb.RemoveExceptionjakarta.ejb.EJBExceptionRemoteException
-
forceDestroyBean
Force destroy the EJB. Called from postInvokeTx. Note: EJB2.0 section 18.3.1 says that discarding an EJB means that no methods other than finalize() should be invoked on it.- Specified by:
forceDestroyBeanin classBaseContainer
-
getEJBObjectImpl
Called when a remote invocation arrives for an EJB.- Specified by:
getEJBObjectImplin classBaseContainer
-
getEJBLocalObjectImpl
Called from EJBLocalObjectImpl.getLocalObject() while deserializing a local object reference.- Overrides:
getEJBLocalObjectImplin classBaseContainer
-
_getContext
Called from preInvoke which is called from the EJBObject for local and remote invocations.- Specified by:
_getContextin classBaseContainer
-
_constructEJBContextImpl
- Overrides:
_constructEJBContextImplin classBaseContainer
-
doTimerInvocationInit
Description copied from class:BaseContainerThis is implemented by concrete containers that support TimedObjects.- Overrides:
doTimerInvocationInitin classBaseContainer- Throws:
Exception
-
userTransactionMethodsAllowed
public boolean userTransactionMethodsAllowed(org.glassfish.api.invocation.ComponentInvocation inv) Description copied from class:BaseContainerEJB 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:
userTransactionMethodsAllowedin interfaceContainer- Overrides:
userTransactionMethodsAllowedin classBaseContainer
-
releaseContext
Called from preInvoke which is called from the EJBObject for local and remote invocations.- Specified by:
releaseContextin classBaseContainer
-
isIdentical
protected boolean isIdentical(EJBObjectImpl ejbo, jakarta.ejb.EJBObject other) throws RemoteException - Overrides:
isIdenticalin classBaseContainer- Throws:
RemoteException
-
checkExists
Check if the given EJBObject/LocalObject has been removed.- Overrides:
checkExistsin classBaseContainer
-
afterBegin
- Specified by:
afterBeginin classBaseContainer
-
beforeCompletion
- Specified by:
beforeCompletionin classBaseContainer
-
afterCompletion
- Specified by:
afterCompletionin classBaseContainer
-
passivateEJB
- Specified by:
passivateEJBin classBaseContainer- Returns:
- false
-
activateEJB
Doesn't do anything by default. -
doConcreteContainerShutdown
protected void doConcreteContainerShutdown(boolean appBeingUndeployed) - Specified by:
doConcreteContainerShutdownin classBaseContainer
-
getMethodReadyCount
public long getMethodReadyCount() -
getMaxPoolSize
public int getMaxPoolSize() -
getSteadyPoolSize
public int getSteadyPoolSize()
-