public class StatelessSessionContainer extends BaseContainer
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.
| Modifier and Type | Class and Description |
|---|---|
protected class |
StatelessSessionContainer.SessionContextFactory |
BaseContainer.ContainerInfo, BaseContainer.ContainerType, BaseContainer.PreInvokeException| Modifier and Type | Field and Description |
|---|---|
protected AbstractPool |
pool |
_logger, cacheProbeListener, cacheProbeNotifier, callFlowInfo, componentId, CONTAINER_INITIALIZING, CONTAINER_ON_HOLD, CONTAINER_STARTED, CONTAINER_STOPPED, CONTAINER_UNDEPLOYED, containerInfo, containerState, containerStateManager, containerTransactionManager, containerType, 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, executorProbeListener, hasLocalBusinessView, hasLocalHomeView, hasOptionalLocalBusinessView, hasRemoteBusinessView, hasRemoteHomeView, homeIntf, injectionManager, interceptorManager, invocationInfoMap, invocationManager, isBeanManagedTran, isLocal, isMessageDriven, isRemote, isSession, isSingleton, isStatefulSession, isStatelessSession, isWebServiceEndpoint, jcdiService, loader, localBusinessHomeIntf, localBusinessIntfs, localHomeIntf, logParams, metadata, methodMonitorMap, monitorOn, namingManager, NO_PARAMS, optIntfClassLoader, poolProbeListener, remoteBusinessHomeIntf, remoteBusinessIntfInfo, remoteHomeRefFactory, remoteIntf, scheduleIds, securityManager, sfsbSerializedClass, SINGLETON_BEAN_POOL_PROP, timerProbeListener, timerProbeNotifier, transactionManager, webServiceEndpointIntf, webServiceInvocationInfoMapSEC_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| Modifier | Constructor and Description |
|---|---|
protected |
StatelessSessionContainer(BaseContainer.ContainerType conType,
EjbDescriptor desc,
ClassLoader loader,
SecurityManager sm) |
| Modifier and Type | Method and Description |
|---|---|
protected EJBContextImpl |
_constructEJBContextImpl(Object instance) |
protected ComponentContext |
_getContext(EjbInvocation inv)
Called from preInvoke which is called from the EJBObject
for local and remote invocations.
|
void |
activateEJB(Object ctx,
Object instanceKey) |
protected void |
afterBegin(EJBContextImpl context) |
protected void |
afterCompletion(EJBContextImpl ctx,
int status) |
protected void |
beforeCompletion(EJBContextImpl context) |
protected void |
checkExists(EJBLocalRemoteObject ejbObj)
Check if the given EJBObject/LocalObject has been removed.
|
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(StringBuilder sbuf) {
sbuf.append("\nStatelessContainer: ")
.append("CreateCount=").append(statCreateCount).append("; ")
.append("RemoveCount=").append(statRemoveCount).append("; ")
.append("]");
}
|
protected void |
doTimerInvocationInit(EjbInvocation inv,
Object primaryKey)
This is implemented by concrete containers that support TimedObjects.
|
protected void |
forceDestroyBean(EJBContextImpl sc)
Force destroy the EJB.
|
protected EJBLocalObjectImpl |
getEJBLocalObjectImpl(Object key)
Called from EJBLocalObjectImpl.getLocalObject() while deserializing
a local object reference.
|
protected EJBObjectImpl |
getEJBObjectImpl(byte[] instanceKey)
Called when a remote invocation arrives for an EJB.
|
int |
getMaxPoolSize() |
long |
getMethodReadyCount() |
String |
getMonitorAttributeValues() |
protected EjbMonitoringStatsProvider |
getMonitoringStatsProvider(String appName,
String modName,
String ejbName) |
int |
getSteadyPoolSize() |
protected void |
initializeHome()
Called from the ContainerFactory during initialization.
|
protected boolean |
isIdentical(EJBObjectImpl ejbo,
javax.ejb.EJBObject other) |
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.
|
protected void |
removeBean(EJBLocalRemoteObject ejbo,
Method removeMethod,
boolean local) |
protected boolean |
resumeTransaction(EjbInvocation inv) |
boolean |
scanForEjbCreateMethod() |
protected boolean |
suspendTransaction(EjbInvocation inv) |
boolean |
userTransactionMethodsAllowed(ComponentInvocation inv)
EJB spec makes a distinction between access to the UserTransaction
object itself and access to its methods.
|
_constructEJBInstance, _createJCDIInjectionContext, _createJCDIInjectionContext, addInvocationInfo, addLocalRemoteInvocationInfo, addProxyInterfacesSetClass, adjustHomeTargetMethodInfo, adjustInvocationInfo, assertValidLocalObject, assertValidRemoteObject, authorize, authorizeLocalGetPrimaryKey, authorizeLocalMethod, authorizeRemoteGetPrimaryKey, authorizeRemoteMethod, callEJBTimeout, cancelTimers, checkExceptionClientTx, checkUnfinishedTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createEjbInstanceForInterceptors, createEjbInvocation, createEjbInvocation, createEmptyContextAndInterceptors, createMonitoringRegistry, createRemoteReferenceWithId, delistExtendedEntityManagers, doAfterBegin, doEJBHomeRemove, doFlush, enlistExtendedEntityManagers, externalPostInvoke, externalPreInvoke, findFlushEnabledAttr, getApplicationId, getClassLoader, getComponentId, getContainerClassLoader, getContainerId, getContainerType, 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, initialize, initializeProtocolManager, injectEjbInstance, instantiateEJBLocalBusinessObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBObjectImpl, instantiateEJBObjectImpl, instantiateOptionalEJBLocalBusinessObjectImpl, instantiateRemoteBusinessObjectImpl, intercept, intercept, invokeBeanMethod, invokeFindByPrimaryKey, invokeTargetBeanMethod, isApplicationException, isCreateHomeFinder, isEjbTimeoutMethod, isHAEnabled, isJCDIEnabled, 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, registerTimerMonitorableComponent, releaseTargetObject, removeBeanUnchecked, removeBeanUnchecked, setDebugMonitorFlag, setEJBMetaData, setStartedState, setStoppedState, setUndeployedState, startApplication, toString, undeploy, useClientTx, validateEMForClientTx, validateTxAttr, webServicePostInvokeprotected AbstractPool pool
protected StatelessSessionContainer(BaseContainer.ContainerType conType, EjbDescriptor desc, ClassLoader loader, SecurityManager sm) throws Exception
Exceptionpublic String getMonitorAttributeValues()
protected boolean suspendTransaction(EjbInvocation inv) throws Exception
suspendTransaction in class BaseContainerExceptionprotected boolean resumeTransaction(EjbInvocation inv) throws Exception
resumeTransaction in class BaseContainerExceptionpublic boolean scanForEjbCreateMethod()
scanForEjbCreateMethod in class BaseContainerprotected EjbMonitoringStatsProvider getMonitoringStatsProvider(String appName, String modName, String ejbName)
getMonitoringStatsProvider in class BaseContainerprotected void initializeHome()
throws Exception
BaseContainerinitializeHome in class BaseContainerExceptionprotected void createBeanPool()
protected void registerMonitorableComponents()
registerMonitorableComponents in class BaseContainerpublic void onReady()
BaseContaineronReady in interface ContaineronReady in class BaseContainerpublic EJBObjectImpl createRemoteBusinessObjectImpl() throws javax.ejb.CreateException, RemoteException
javax.ejb.CreateExceptionRemoteExceptionpublic EJBObjectImpl createEJBObjectImpl() throws javax.ejb.CreateException, RemoteException
createEJBObjectImpl in class BaseContainerjavax.ejb.CreateExceptionRemoteExceptionpublic EJBLocalObjectImpl createEJBLocalObjectImpl() throws javax.ejb.CreateException
createEJBLocalObjectImpl in class BaseContainerjavax.ejb.CreateExceptionpublic EJBLocalObjectImpl createEJBLocalBusinessObjectImpl(boolean localBeanView) throws javax.ejb.CreateException
javax.ejb.CreateExceptionprotected void removeBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws javax.ejb.RemoveException, javax.ejb.EJBException, RemoteException
removeBean in class BaseContainerjavax.ejb.RemoveExceptionjavax.ejb.EJBExceptionRemoteExceptionprotected void forceDestroyBean(EJBContextImpl sc)
forceDestroyBean in class BaseContainerprotected EJBObjectImpl getEJBObjectImpl(byte[] instanceKey)
getEJBObjectImpl in class BaseContainerprotected EJBLocalObjectImpl getEJBLocalObjectImpl(Object key)
getEJBLocalObjectImpl in class BaseContainerprotected ComponentContext _getContext(EjbInvocation inv)
_getContext in class BaseContainerprotected EJBContextImpl _constructEJBContextImpl(Object instance)
_constructEJBContextImpl in class BaseContainerprotected void doTimerInvocationInit(EjbInvocation inv, Object primaryKey) throws Exception
BaseContainerdoTimerInvocationInit in class BaseContainerExceptionpublic boolean userTransactionMethodsAllowed(ComponentInvocation inv)
BaseContaineruserTransactionMethodsAllowed in interface ContaineruserTransactionMethodsAllowed in class BaseContainerpublic void releaseContext(EjbInvocation inv)
releaseContext in class BaseContainerprotected boolean isIdentical(EJBObjectImpl ejbo, javax.ejb.EJBObject other) throws RemoteException
isIdentical in class BaseContainerRemoteExceptionprotected void checkExists(EJBLocalRemoteObject ejbObj)
checkExists in class BaseContainerjavax.ejb.NoSuchObjectLocalException - if the object has been removed.protected void afterBegin(EJBContextImpl context)
afterBegin in class BaseContainerprotected void beforeCompletion(EJBContextImpl context)
beforeCompletion in class BaseContainerprotected void afterCompletion(EJBContextImpl ctx, int status)
afterCompletion in class BaseContainerpublic boolean passivateEJB(ComponentContext context)
passivateEJB in class BaseContainerprotected void doConcreteContainerShutdown(boolean appBeingUndeployed)
doConcreteContainerShutdown in class BaseContainerpublic long getMethodReadyCount()
public int getMaxPoolSize()
public int getSteadyPoolSize()
Copyright © 2019. All rights reserved.