public final class StatefulSessionContainer extends BaseContainer implements CacheListener, SFSBContainerCallback
BaseContainer.ContainerInfo, BaseContainer.ContainerType, BaseContainer.PreInvokeException
Modifier and Type | Field and Description |
---|---|
static int |
MIN_PASSIVATION_BATCH_COUNT |
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, webServiceInvocationInfoMap
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 and Description |
---|
StatefulSessionContainer(BaseContainer.ContainerType conType,
EjbDescriptor desc,
ClassLoader loader,
SecurityManager sm) |
StatefulSessionContainer(EjbDescriptor desc,
ClassLoader loader,
SecurityManager sm)
This constructor is called from the JarManager when a Jar is deployed.
|
Modifier and Type | Method and Description |
---|---|
protected EJBContextImpl |
_constructEJBContextImpl(Object instance) |
protected Object |
_constructEJBInstance() |
ComponentContext |
_getContext(EjbInvocation ejbInvocation)
Called from preInvoke which is called from the EJBObject
for local and remote invocations.
|
void |
activateEJB(Object sessionKey,
StatefulEJBContext sfsbCtx,
Object cookie) |
protected void |
afterBegin(EJBContextImpl context) |
protected void |
afterCompletion(EJBContextImpl context,
int status) |
protected void |
beforeCompletion(EJBContextImpl context) |
boolean |
canPassivateEJB(ComponentContext context) |
protected void |
checkExists(EJBLocalRemoteObject ejbObj)
Check if the given EJBObject/LocalObject has been removed.
|
protected void |
checkUnfinishedTx(Transaction prevTx,
EjbInvocation inv) |
protected EJBLocalObjectImpl |
createEJBLocalObjectImpl()
This is called from the generated "HelloEJBLocalHomeImpl" create method
via EJBLocalHomeImpl.createEJBObject.
|
protected EJBObjectImpl |
createEJBObjectImpl()
This is called from the generated "HelloEJBHomeImpl" create method
via EJBHomeImpl.createEJBObject.
|
protected EJBObjectImpl |
createRemoteBusinessObjectImpl() |
void |
decrementMethodReadyStat() |
protected void |
delistExtendedEntityManagers(ComponentContext ctx) |
Object |
deserializeData(byte[] data) |
protected void |
doConcreteContainerShutdown(boolean appBeingUndeployed) |
protected void |
enlistExtendedEntityManagers(ComponentContext ctx) |
protected void |
forceDestroyBean(EJBContextImpl ctx)
Force destroy the EJB and rollback any Tx it was associated with
Called from removeBean, timeoutBean and BaseContainer.postInvokeTx.
|
org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> |
getBackingStore() |
protected EJBLocalObjectImpl |
getEJBLocalObjectImpl(Object sessionKey)
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 |
getMaxCacheSize() |
long |
getMethodReadyCount() |
String |
getMonitorAttributeValues() |
protected EjbMonitoringStatsProvider |
getMonitoringStatsProvider(String appName,
String modName,
String ejbName) |
int |
getPassivationBatchCount() |
long |
getPassiveCount() |
protected String[] |
getPre30LifecycleMethodNames() |
void |
incrementMethodReadyStat() |
protected void |
initializeHome()
Called from the ContainerFactory during initialization.
|
protected Object |
intercept(EjbInvocation inv)
Called from various places within the container that are responsible
for dispatching invocations to business methods.
|
boolean |
intercept(LifecycleCallbackDescriptor.CallbackType eventType,
EJBContextImpl ctx) |
void |
invokePeriodically(long delay,
long periodicity,
Runnable target) |
boolean |
isHAEnabled() |
protected boolean |
isIdentical(EJBObjectImpl ejbo,
javax.ejb.EJBObject other) |
boolean |
isPassivationCapable() |
protected void |
loadCheckpointInfo() |
javax.persistence.EntityManager |
lookupExtendedEntityManager(javax.persistence.EntityManagerFactory emf)
Containers that allow extended EntityManager will override this method.
|
void |
onUndeploy(StatefulEJBContext sfsbCtx) |
boolean |
passivateEJB(ComponentContext context) |
boolean |
passivateEJB(StatefulEJBContext sfsbCtx) |
protected void |
postInvokeTx(EjbInvocation inv)
postInvokeTx is called after every invocation on the EJB instance,
including ejbCreate/ejbFind---/ejbRemove.
|
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) |
void |
removeExpiredSessions() |
void |
removeTimedoutBean(EJBContextImpl ctx) |
protected boolean |
resumeTransaction(EjbInvocation inv) |
byte[] |
serializeContext(StatefulEJBContext ctx) |
void |
setBackingStore(org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> store) |
void |
setHAEnabled(boolean isHAEnabled) |
void |
setPassivationBatchCount(int count) |
void |
setRemovalGracePeriodInSeconds(int val) |
void |
setSessionCache(LruSessionCache cache) |
void |
setSFSBUUIDUtil(SFSBUUIDUtil util) |
void |
setSFSBVersionManager(SFSBVersionManager sfsbVersionManager) |
void |
startApplication(boolean deploy)
Called after all the components in the container's application
have deployed successfully.
|
protected boolean |
suspendTransaction(EjbInvocation inv) |
void |
trimEvent(Object primaryKey,
Object context)
an cached value is trimmed (to prevent cache overflow)
|
void |
undeploy(SessionContextImpl ctx) |
boolean |
userTransactionMethodsAllowed(ComponentInvocation inv)
EJB spec makes a distinction between access to the UserTransaction
object itself and access to its methods.
|
protected void |
validateEMForClientTx(EjbInvocation inv,
JavaEETransaction clientJ2EETx) |
_createJCDIInjectionContext, _createJCDIInjectionContext, addInvocationInfo, addLocalRemoteInvocationInfo, addProxyInterfacesSetClass, adjustHomeTargetMethodInfo, adjustInvocationInfo, assertValidLocalObject, assertValidRemoteObject, authorize, authorizeLocalGetPrimaryKey, authorizeLocalMethod, authorizeRemoteGetPrimaryKey, authorizeRemoteMethod, callEJBTimeout, cancelTimers, checkExceptionClientTx, checkUserTransactionLookup, cleanupInstance, containerStateToString, createCallFlowAgent, createEjbInstanceAndContext, createEjbInstanceForInterceptors, createEjbInvocation, createEjbInvocation, createEmptyContextAndInterceptors, createMonitoringRegistry, createRemoteReferenceWithId, doAfterBegin, doEJBHomeRemove, doFlush, doTimerInvocationInit, 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, getProtocolManager, getSecurityManager, getTargetObject, getTimeoutMethod, getTxAttr, getTxAttr, getTxAttrForLifecycleCallback, getUserTransaction, getUseThreadPoolId, incrementCreatedTimedObject, incrementDeliveredTimedObject, incrementRemovedTimedObject, initialize, initializeProtocolManager, injectEjbInstance, instantiateEJBLocalBusinessObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBLocalObjectImpl, instantiateEJBObjectImpl, instantiateEJBObjectImpl, instantiateOptionalEJBLocalBusinessObjectImpl, instantiateRemoteBusinessObjectImpl, invokeBeanMethod, invokeFindByPrimaryKey, invokeTargetBeanMethod, isApplicationException, isCreateHomeFinder, isEjbTimeoutMethod, isJCDIEnabled, isLocalInterfaceSupported, isLocalObject, isRemoteInterfaceSupported, isRemoteObject, isStopped, isSystemUncheckedException, isTimedObject, isUndeployed, onEnteringContainer, onLeavingContainer, onReady, onShutdown, onTermination, postCreate, postEjbTimeout, postFind, postInvoke, postInvoke, postInvokeNoTx, postProcessInvocationInfo, preInitialize, preInvoke, preInvokeNoTx, preInvokeTx, prepareEjbTimeoutParams, preSelect, registerTimerMonitorableComponent, releaseTargetObject, removeBeanUnchecked, removeBeanUnchecked, scanForEjbCreateMethod, setDebugMonitorFlag, setEJBMetaData, setStartedState, setStoppedState, setUndeployedState, toString, undeploy, useClientTx, validateTxAttr, webServicePostInvoke
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClassLoader
public static final int MIN_PASSIVATION_BATCH_COUNT
public StatefulSessionContainer(EjbDescriptor desc, ClassLoader loader, SecurityManager sm) throws Exception
Exception
- on errorpublic StatefulSessionContainer(BaseContainer.ContainerType conType, EjbDescriptor desc, ClassLoader loader, SecurityManager sm) throws Exception
Exception
public boolean isPassivationCapable()
isPassivationCapable
in interface SFSBContainerCallback
protected void initializeHome() throws Exception
BaseContainer
initializeHome
in class BaseContainer
Exception
public void startApplication(boolean deploy)
BaseContainer
startApplication
in interface Container
startApplication
in class BaseContainer
deploy
- true if this method is called during application deployprotected void checkUnfinishedTx(Transaction prevTx, EjbInvocation inv)
checkUnfinishedTx
in class BaseContainer
protected void loadCheckpointInfo()
protected void registerMonitorableComponents()
registerMonitorableComponents
in class BaseContainer
public String getMonitorAttributeValues()
protected EjbMonitoringStatsProvider getMonitoringStatsProvider(String appName, String modName, String ejbName)
getMonitoringStatsProvider
in class BaseContainer
protected boolean isIdentical(EJBObjectImpl ejbo, javax.ejb.EJBObject other) throws RemoteException
isIdentical
in class BaseContainer
RemoteException
protected EJBObjectImpl createEJBObjectImpl() throws javax.ejb.CreateException, RemoteException
createEJBObjectImpl
in class BaseContainer
javax.ejb.CreateException
RemoteException
protected EJBObjectImpl createRemoteBusinessObjectImpl() throws javax.ejb.CreateException, RemoteException
javax.ejb.CreateException
RemoteException
protected EJBLocalObjectImpl createEJBLocalObjectImpl() throws javax.ejb.CreateException
createEJBLocalObjectImpl
in class BaseContainer
javax.ejb.CreateException
protected EJBContextImpl _constructEJBContextImpl(Object instance)
_constructEJBContextImpl
in class BaseContainer
protected Object _constructEJBInstance() throws Exception
_constructEJBInstance
in class BaseContainer
Exception
protected boolean suspendTransaction(EjbInvocation inv) throws Exception
suspendTransaction
in class BaseContainer
Exception
protected boolean resumeTransaction(EjbInvocation inv) throws Exception
resumeTransaction
in class BaseContainer
Exception
public javax.persistence.EntityManager lookupExtendedEntityManager(javax.persistence.EntityManagerFactory emf)
BaseContainer
lookupExtendedEntityManager
in interface JavaEEContainer
lookupExtendedEntityManager
in class BaseContainer
protected void removeBean(EJBLocalRemoteObject ejbo, Method removeMethod, boolean local) throws javax.ejb.RemoveException, javax.ejb.EJBException
removeBean
in class BaseContainer
javax.ejb.RemoveException
javax.ejb.EJBException
protected void forceDestroyBean(EJBContextImpl ctx)
forceDestroyBean
in class BaseContainer
public boolean userTransactionMethodsAllowed(ComponentInvocation inv)
BaseContainer
userTransactionMethodsAllowed
in interface Container
userTransactionMethodsAllowed
in class BaseContainer
public void removeTimedoutBean(EJBContextImpl ctx)
protected EJBObjectImpl getEJBObjectImpl(byte[] instanceKey)
BaseContainer
getEJBObjectImpl
in class BaseContainer
protected EJBLocalObjectImpl getEJBLocalObjectImpl(Object sessionKey)
getEJBLocalObjectImpl
in class BaseContainer
protected void checkExists(EJBLocalRemoteObject ejbObj)
checkExists
in class BaseContainer
javax.ejb.NoSuchObjectLocalException
- if the object has been removed.public ComponentContext _getContext(EjbInvocation ejbInvocation)
_getContext
in class BaseContainer
public boolean isHAEnabled()
isHAEnabled
in class BaseContainer
protected void postInvokeTx(EjbInvocation inv) throws Exception
BaseContainer
postInvokeTx
in class BaseContainer
Exception
public void releaseContext(EjbInvocation inv)
releaseContext
in class BaseContainer
protected void afterBegin(EJBContextImpl context)
afterBegin
in class BaseContainer
protected void beforeCompletion(EJBContextImpl context)
beforeCompletion
in class BaseContainer
protected void afterCompletion(EJBContextImpl context, int status)
afterCompletion
in class BaseContainer
public final boolean canPassivateEJB(ComponentContext context)
public final boolean passivateEJB(ComponentContext context)
passivateEJB
in class BaseContainer
public final int getPassivationBatchCount()
getPassivationBatchCount
in interface SFSBContainerCallback
public final void setPassivationBatchCount(int count)
public final boolean passivateEJB(StatefulEJBContext sfsbCtx)
passivateEJB
in interface SFSBContainerCallback
public long getMethodReadyCount()
public long getPassiveCount()
public void activateEJB(Object sessionKey, StatefulEJBContext sfsbCtx, Object cookie)
activateEJB
in interface SFSBContainerCallback
public byte[] serializeContext(StatefulEJBContext ctx) throws IOException
serializeContext
in interface SFSBContainerCallback
IOException
public Object deserializeData(byte[] data) throws Exception
deserializeData
in interface SFSBContainerCallback
Exception
protected void validateEMForClientTx(EjbInvocation inv, JavaEETransaction clientJ2EETx) throws javax.ejb.EJBException
validateEMForClientTx
in class BaseContainer
javax.ejb.EJBException
protected void enlistExtendedEntityManagers(ComponentContext ctx)
enlistExtendedEntityManagers
in class BaseContainer
protected void delistExtendedEntityManagers(ComponentContext ctx)
delistExtendedEntityManagers
in class BaseContainer
public void invokePeriodically(long delay, long periodicity, Runnable target)
invokePeriodically
in interface SFSBContainerCallback
public void onUndeploy(StatefulEJBContext sfsbCtx)
protected String[] getPre30LifecycleMethodNames()
getPre30LifecycleMethodNames
in class BaseContainer
protected void doConcreteContainerShutdown(boolean appBeingUndeployed)
doConcreteContainerShutdown
in class BaseContainer
protected Object intercept(EjbInvocation inv) throws Throwable
BaseContainer
intercept
in class BaseContainer
Throwable
public boolean intercept(LifecycleCallbackDescriptor.CallbackType eventType, EJBContextImpl ctx) throws Throwable
intercept
in class BaseContainer
Throwable
public void undeploy(SessionContextImpl ctx)
public void trimEvent(Object primaryKey, Object context)
CacheListener
trimEvent
in interface CacheListener
primaryKey
- lookup keycontext
- value of the cached entitypublic void setSFSBUUIDUtil(SFSBUUIDUtil util)
public void setHAEnabled(boolean isHAEnabled)
public void setSessionCache(LruSessionCache cache)
public void setRemovalGracePeriodInSeconds(int val)
public void removeExpiredSessions()
public void setSFSBVersionManager(SFSBVersionManager sfsbVersionManager)
public int getMaxCacheSize()
public org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> getBackingStore()
public void setBackingStore(org.glassfish.ha.store.api.BackingStore<Serializable,org.glassfish.ha.store.util.SimpleMetadata> store)
public void incrementMethodReadyStat()
public void decrementMethodReadyStat()
Copyright © 2019. All rights reserved.