Class EJBContextImpl

java.lang.Object
com.sun.ejb.containers.EJBContextImpl
All Implemented Interfaces:
ComponentContext, jakarta.ejb.EJBContext, Serializable, org.glassfish.api.invocation.ResourceHandler
Direct Known Subclasses:
AbstractSessionContextImpl

public abstract class EJBContextImpl extends Object implements jakarta.ejb.EJBContext, ComponentContext, Serializable
Implementation of jakarta.ejb.EJBContext for the J2EE Reference Implementation.
See Also:
  • Field Details

    • container

      protected transient BaseContainer container
    • transaction

      protected transient jakarta.transaction.Transaction transaction
    • initialContext

      protected transient Context initialContext
    • ejbStub

      protected transient jakarta.ejb.EJBObject ejbStub
    • ejbObjectImpl

      protected transient EJBObjectImpl ejbObjectImpl
    • ejbRemoteBusinessObjectImpl

      protected transient EJBObjectImpl ejbRemoteBusinessObjectImpl
    • ejbLocalObjectImpl

      protected transient EJBLocalObjectImpl ejbLocalObjectImpl
    • ejbLocalBusinessObjectImpl

      protected transient EJBLocalObjectImpl ejbLocalBusinessObjectImpl
    • optionalEjbLocalBusinessObjectImpl

      protected transient EJBLocalObjectImpl optionalEjbLocalBusinessObjectImpl
    • state

      protected transient EJBContextImpl.BeanState state
    • isRemoteInterfaceSupported

      protected boolean isRemoteInterfaceSupported
    • isLocalInterfaceSupported

      protected boolean isLocalInterfaceSupported
    • inEjbRemove

      protected transient boolean inEjbRemove
    • cdiInjectionContext

      protected transient com.sun.enterprise.container.common.spi.CDIService.CDIInjectionContext cdiInjectionContext
  • Constructor Details

  • Method Details

    • getTransaction

      public jakarta.transaction.Transaction getTransaction()
      Description copied from interface: ComponentContext
      Get the Transaction object associated with this Context.
      Specified by:
      getTransaction in interface ComponentContext
    • setTransaction

      public void setTransaction(jakarta.transaction.Transaction tr)
    • getState

      protected EJBContextImpl.BeanState getState()
    • getLastTimeUsed

      public long getLastTimeUsed()
    • touch

      public void touch()
    • getEJB

      public Object getEJB()
      Description copied from interface: ComponentContext
      Get the EJB instance associated with this context.
      Specified by:
      getEJB in interface ComponentContext
    • getContainer

      public final Container getContainer()
      Description copied from interface: ComponentContext
      Get the Container instance which created this Context.
      Specified by:
      getContainer in interface ComponentContext
    • registerResource

      public void registerResource(com.sun.appserv.connectors.internal.api.ResourceHandle h)
      Register a resource opened by the EJB instance associated with this Context.
    • unregisterResource

      public void unregisterResource(com.sun.appserv.connectors.internal.api.ResourceHandle h)
      Unregister a resource from this Context.
    • getResourceList

      public List getResourceList()
      Get all the resources associated with the context
      Specified by:
      getResourceList in interface ComponentContext
      Specified by:
      getResourceList in interface org.glassfish.api.invocation.ResourceHandler
    • getConcurrentInvokeCount

      public int getConcurrentInvokeCount()
      Get the number of concurrent invocations on this bean (could happen with re-entrant bean). Used by TM.
    • incrementConcurrentInvokeCount

      public void incrementConcurrentInvokeCount()
      Increment the number of concurrent invocations on this bean (could happen with re-entrant bean). Used by TM.
    • decrementConcurrentInvokeCount

      public void decrementConcurrentInvokeCount()
      Decrement the number of concurrent invocations on this bean (could happen with re-entrant bean). Used by TM.
    • getEJBObject

      public jakarta.ejb.EJBObject getEJBObject() throws IllegalStateException
      This is a SessionContext/EntityContext method.
      Throws:
      IllegalStateException
    • getEJBLocalObject

      public jakarta.ejb.EJBLocalObject getEJBLocalObject() throws IllegalStateException
      This is a SessionContext/EntityContext method.
      Throws:
      IllegalStateException
    • getEJBHome

      public jakarta.ejb.EJBHome getEJBHome()
      Specified by:
      getEJBHome in interface jakarta.ejb.EJBContext
    • getEJBLocalHome

      public jakarta.ejb.EJBLocalHome getEJBLocalHome()
      Specified by:
      getEJBLocalHome in interface jakarta.ejb.EJBContext
    • getEnvironment

      public Properties getEnvironment()
    • getCallerIdentity

      @Deprecated public Identity getCallerIdentity()
      Deprecated.
    • lookup

      public Object lookup(String name)
      Specified by:
      lookup in interface jakarta.ejb.EJBContext
    • getCallerPrincipal

      public Principal getCallerPrincipal()
      Specified by:
      getCallerPrincipal in interface jakarta.ejb.EJBContext
    • getContextData

      public Map<String,Object> getContextData()
      Specified by:
      getContextData in interface jakarta.ejb.EJBContext
      Returns:
      Returns the contextMetaData.
    • isCallerInRole

      public boolean isCallerInRole(String roleRef)
      Specified by:
      isCallerInRole in interface jakarta.ejb.EJBContext
    • checkAccessToCallerSecurity

      protected void checkAccessToCallerSecurity() throws IllegalStateException
      Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()
      Throws:
      IllegalStateException
    • getUserTransaction

      public jakarta.transaction.UserTransaction getUserTransaction() throws IllegalStateException
      Specified by:
      getUserTransaction in interface jakarta.ejb.EJBContext
      Throws:
      IllegalStateException
    • setRollbackOnly

      public void setRollbackOnly() throws IllegalStateException
      Specified by:
      setRollbackOnly in interface jakarta.ejb.EJBContext
      Throws:
      IllegalStateException
    • getRollbackOnly

      public boolean getRollbackOnly() throws IllegalStateException
      Specified by:
      getRollbackOnly in interface jakarta.ejb.EJBContext
      Throws:
      IllegalStateException
    • doGetSetRollbackTxAttrCheck

      protected void doGetSetRollbackTxAttrCheck()
    • getInterceptorInstances

      public Object[] getInterceptorInstances()
    • checkTimerServiceMethodAccess

      public void checkTimerServiceMethodAccess() throws IllegalStateException
      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
      Throws:
      IllegalStateException
    • checkActivatePassivate

      protected void checkActivatePassivate() throws IllegalStateException
      Throws:
      IllegalStateException
    • inActivatePassivate

      protected boolean inActivatePassivate()
    • inActivatePassivate

      protected boolean inActivatePassivate(org.glassfish.api.invocation.ComponentInvocation inv)
    • getKey

      protected Object getKey()