Package com.sun.ejb.containers
Class SessionContextImpl
- java.lang.Object
-
- com.sun.ejb.containers.EJBContextImpl
-
- com.sun.ejb.containers.AbstractSessionContextImpl
-
- com.sun.ejb.containers.SessionContextImpl
-
- All Implemented Interfaces:
ComponentContext,StatefulEJBContext,jakarta.ejb.EJBContext,jakarta.ejb.SessionContext,Serializable,org.glassfish.api.invocation.ResourceHandler
public final class SessionContextImpl extends AbstractSessionContextImpl implements StatefulEJBContext
Implementation of EJBContext for SessionBeans- Author:
- Mahesh Kannan
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.sun.ejb.containers.EJBContextImpl
EJBContextImpl.BeanState
-
-
Field Summary
-
Fields inherited from class com.sun.ejb.containers.AbstractSessionContextImpl
ejbName, instanceKey
-
Fields inherited from class com.sun.ejb.containers.EJBContextImpl
container, ejbLocalBusinessObjectImpl, ejbLocalObjectImpl, ejbObjectImpl, ejbRemoteBusinessObjectImpl, ejbStub, inEjbRemove, initialContext, isLocalInterfaceSupported, isRemoteInterfaceSupported, jcdiInjectionContext, optionalEjbLocalBusinessObjectImpl, state, transaction
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtendedEntityManagerMapping(jakarta.persistence.EntityManagerFactory emf, com.sun.ejb.containers.StatefulSessionContainer.EEMRefInfo refInfo)booleancanBePassivated()protected voidcheckAccessToCallerSecurity()Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()voidcheckTimerServiceMethodAccess()The EJB spec makes a distinction between access to the TimerService object itself (via EJBContext.getTimerService) and access to the methods on TimerService, Timer, and TimerHandle.voiddecrementRefCount()booleanexistsInStore()com.sun.enterprise.container.common.impl.PhysicalEntityManagerWrappergetExtendedEntityManager(jakarta.persistence.EntityManagerFactory emf)Map<jakarta.persistence.EntityManagerFactory,com.sun.enterprise.container.common.impl.PhysicalEntityManagerWrapper>getExtendedEntityManagerMap()Collection<com.sun.enterprise.container.common.impl.PhysicalEntityManagerWrapper>getExtendedEntityManagers()longgetLastAccessTime()intgetRefCount()jakarta.ejb.SessionContextgetSessionContext()ReentrantReadWriteLock.WriteLockgetStatefulWriteLock()jakarta.ejb.TimerServicegetTimerService()longgetVersion()booleanhasExtendedPC()longincrementAndGetVersion()voidincrementRefCount()voidinitializeStatefulWriteLock()booleanisEmfRegisteredWithTx(jakarta.persistence.EntityManagerFactory emf)voidsetEmfRegisteredWithTx(jakarta.persistence.EntityManagerFactory emf, boolean flag)voidsetExistsInStore(boolean val)voidsetStatefulWriteLock(SessionContextImpl other)voidsetVersion(long newVersion)-
Methods inherited from class com.sun.ejb.containers.AbstractSessionContextImpl
getBusinessObject, getCurrentComponentInvocation, getInstanceKey, getInvokedBusinessInterface, getUserTransaction, setInstanceKey, toString, wasCancelCalled
-
Methods inherited from class com.sun.ejb.containers.EJBContextImpl
checkActivatePassivate, decrementConcurrentInvokeCount, doGetSetRollbackTxAttrCheck, getCallerIdentity, getCallerPrincipal, getConcurrentInvokeCount, getContainer, getContextData, getEJB, getEJBHome, getEJBLocalHome, getEJBLocalObject, getEJBObject, getEnvironment, getInterceptorInstances, getKey, getLastTimeUsed, getResourceList, getRollbackOnly, getState, getTransaction, inActivatePassivate, inActivatePassivate, incrementConcurrentInvokeCount, isCallerInRole, isCallerInRole, lookup, registerResource, setRollbackOnly, setTransaction, touch, unregisterResource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getExtendedEntityManagerMap
public Map<jakarta.persistence.EntityManagerFactory,com.sun.enterprise.container.common.impl.PhysicalEntityManagerWrapper> getExtendedEntityManagerMap()
-
addExtendedEntityManagerMapping
public void addExtendedEntityManagerMapping(jakarta.persistence.EntityManagerFactory emf, com.sun.ejb.containers.StatefulSessionContainer.EEMRefInfo refInfo)
-
getExtendedEntityManager
public com.sun.enterprise.container.common.impl.PhysicalEntityManagerWrapper getExtendedEntityManager(jakarta.persistence.EntityManagerFactory emf)
-
getExtendedEntityManagers
public Collection<com.sun.enterprise.container.common.impl.PhysicalEntityManagerWrapper> getExtendedEntityManagers()
-
setEmfRegisteredWithTx
public void setEmfRegisteredWithTx(jakarta.persistence.EntityManagerFactory emf, boolean flag)
-
isEmfRegisteredWithTx
public boolean isEmfRegisteredWithTx(jakarta.persistence.EntityManagerFactory emf)
-
initializeStatefulWriteLock
public void initializeStatefulWriteLock()
-
getStatefulWriteLock
public ReentrantReadWriteLock.WriteLock getStatefulWriteLock()
-
setStatefulWriteLock
public void setStatefulWriteLock(SessionContextImpl other)
-
getTimerService
public jakarta.ejb.TimerService getTimerService() throws IllegalStateException- Specified by:
getTimerServicein interfacejakarta.ejb.EJBContext- Overrides:
getTimerServicein classAbstractSessionContextImpl- Throws:
IllegalStateException
-
checkAccessToCallerSecurity
protected void checkAccessToCallerSecurity() throws IllegalStateExceptionDescription copied from class:EJBContextImplOverridden in containers that allow access to isCallerInRole() and getCallerPrincipal()- Overrides:
checkAccessToCallerSecurityin classAbstractSessionContextImpl- Throws:
IllegalStateException
-
checkTimerServiceMethodAccess
public void checkTimerServiceMethodAccess() throws IllegalStateExceptionDescription copied from class:EJBContextImplThe EJB spec makes a distinction between access to the TimerService object itself (via EJBContext.getTimerService) and access to the methods on TimerService, Timer, and TimerHandle. The latter case is covered by this check. It is overridden in the applicable concrete context impl subclasses.- Specified by:
checkTimerServiceMethodAccessin interfaceComponentContext- Overrides:
checkTimerServiceMethodAccessin classAbstractSessionContextImpl- Throws:
IllegalStateException
-
getVersion
public long getVersion()
- Specified by:
getVersionin interfaceStatefulEJBContext
-
incrementAndGetVersion
public long incrementAndGetVersion()
- Specified by:
incrementAndGetVersionin interfaceStatefulEJBContext
-
setVersion
public void setVersion(long newVersion)
- Specified by:
setVersionin interfaceStatefulEJBContext
-
getLastAccessTime
public long getLastAccessTime()
- Specified by:
getLastAccessTimein interfaceStatefulEJBContext
-
canBePassivated
public boolean canBePassivated()
- Specified by:
canBePassivatedin interfaceStatefulEJBContext
-
hasExtendedPC
public boolean hasExtendedPC()
-
getSessionContext
public jakarta.ejb.SessionContext getSessionContext()
- Specified by:
getSessionContextin interfaceStatefulEJBContext
-
existsInStore
public boolean existsInStore()
- Specified by:
existsInStorein interfaceStatefulEJBContext
-
setExistsInStore
public void setExistsInStore(boolean val)
- Specified by:
setExistsInStorein interfaceStatefulEJBContext
-
incrementRefCount
public final void incrementRefCount()
-
decrementRefCount
public final void decrementRefCount()
-
getRefCount
public final int getRefCount()
-
-