Class 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:
  • Method Details

    • 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:
      getTimerService in interface jakarta.ejb.EJBContext
      Overrides:
      getTimerService in class AbstractSessionContextImpl
      Throws:
      IllegalStateException
    • checkAccessToCallerSecurity

      protected void checkAccessToCallerSecurity() throws IllegalStateException
      Description copied from class: EJBContextImpl
      Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()
      Overrides:
      checkAccessToCallerSecurity in class AbstractSessionContextImpl
      Throws:
      IllegalStateException
    • checkTimerServiceMethodAccess

      public void checkTimerServiceMethodAccess() throws IllegalStateException
      Description copied from class: EJBContextImpl
      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. The latter case is covered by this check. It is overridden in the applicable concrete context impl subclasses.
      Specified by:
      checkTimerServiceMethodAccess in interface ComponentContext
      Overrides:
      checkTimerServiceMethodAccess in class AbstractSessionContextImpl
      Throws:
      IllegalStateException
    • getVersion

      public long getVersion()
      Specified by:
      getVersion in interface StatefulEJBContext
    • incrementAndGetVersion

      public long incrementAndGetVersion()
      Specified by:
      incrementAndGetVersion in interface StatefulEJBContext
    • setVersion

      public void setVersion(long newVersion)
      Specified by:
      setVersion in interface StatefulEJBContext
    • getLastAccessTime

      public long getLastAccessTime()
      Specified by:
      getLastAccessTime in interface StatefulEJBContext
    • canBePassivated

      public boolean canBePassivated()
      Specified by:
      canBePassivated in interface StatefulEJBContext
    • hasExtendedPC

      public boolean hasExtendedPC()
    • getSessionContext

      public jakarta.ejb.SessionContext getSessionContext()
      Specified by:
      getSessionContext in interface StatefulEJBContext
    • existsInStore

      public boolean existsInStore()
      Specified by:
      existsInStore in interface StatefulEJBContext
    • setExistsInStore

      public void setExistsInStore(boolean val)
      Specified by:
      setExistsInStore in interface StatefulEJBContext
    • incrementRefCount

      public final void incrementRefCount()
    • decrementRefCount

      public final void decrementRefCount()
    • getRefCount

      public final int getRefCount()