Package com.sun.ejb.containers
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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.sun.enterprise.container.common.spi.CDIService.CDIInjectionContextprotected BaseContainerprotected EJBLocalObjectImplprotected EJBLocalObjectImplprotected EJBObjectImplprotected EJBObjectImplprotected jakarta.ejb.EJBObjectprotected booleanprotected Contextprotected booleanprotected booleanprotected EJBLocalObjectImplprotected EJBContextImpl.BeanStateprotected jakarta.transaction.Transaction -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidOverridden in containers that allow access to isCallerInRole() and getCallerPrincipal()protected voidvoidThe 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.voidDecrement the number of concurrent invocations on this bean (could happen with re-entrant bean).protected voidDeprecated.intGet the number of concurrent invocations on this bean (could happen with re-entrant bean).final ContainerGet the Container instance which created this Context.getEJB()Get the EJB instance associated with this context.jakarta.ejb.EJBHomejakarta.ejb.EJBLocalHomejakarta.ejb.EJBLocalObjectThis is a SessionContext/EntityContext method.jakarta.ejb.EJBObjectThis is a SessionContext/EntityContext method.Object[]protected ObjectgetKey()longGet all the resources associated with the contextbooleanprotected EJBContextImpl.BeanStategetState()jakarta.transaction.TransactionGet the Transaction object associated with this Context.jakarta.transaction.UserTransactionprotected booleanprotected booleaninActivatePassivate(org.glassfish.api.invocation.ComponentInvocation inv) voidIncrement the number of concurrent invocations on this bean (could happen with re-entrant bean).booleanisCallerInRole(String roleRef) voidregisterResource(com.sun.appserv.connectors.internal.api.ResourceHandle h) Register a resource opened by the EJB instance associated with this Context.voidvoidsetTransaction(jakarta.transaction.Transaction tr) voidtouch()voidunregisterResource(com.sun.appserv.connectors.internal.api.ResourceHandle h) Unregister a resource from this Context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.ejb.EJBContext
getTimerService
-
Field Details
-
container
-
transaction
protected transient jakarta.transaction.Transaction transaction -
initialContext
-
ejbStub
protected transient jakarta.ejb.EJBObject ejbStub -
ejbObjectImpl
-
ejbRemoteBusinessObjectImpl
-
ejbLocalObjectImpl
-
ejbLocalBusinessObjectImpl
-
optionalEjbLocalBusinessObjectImpl
-
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
-
EJBContextImpl
-
-
Method Details
-
getTransaction
public jakarta.transaction.Transaction getTransaction()Description copied from interface:ComponentContextGet the Transaction object associated with this Context.- Specified by:
getTransactionin interfaceComponentContext
-
setTransaction
public void setTransaction(jakarta.transaction.Transaction tr) -
getState
-
getLastTimeUsed
public long getLastTimeUsed() -
touch
public void touch() -
getEJB
Description copied from interface:ComponentContextGet the EJB instance associated with this context.- Specified by:
getEJBin interfaceComponentContext
-
getContainer
Description copied from interface:ComponentContextGet the Container instance which created this Context.- Specified by:
getContainerin interfaceComponentContext
-
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
Get all the resources associated with the context- Specified by:
getResourceListin interfaceComponentContext- Specified by:
getResourceListin interfaceorg.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
This is a SessionContext/EntityContext method.- Throws:
IllegalStateException
-
getEJBLocalObject
This is a SessionContext/EntityContext method.- Throws:
IllegalStateException
-
getEJBHome
public jakarta.ejb.EJBHome getEJBHome()- Specified by:
getEJBHomein interfacejakarta.ejb.EJBContext
-
getEJBLocalHome
public jakarta.ejb.EJBLocalHome getEJBLocalHome()- Specified by:
getEJBLocalHomein interfacejakarta.ejb.EJBContext
-
getEnvironment
-
getCallerIdentity
Deprecated. -
lookup
- Specified by:
lookupin interfacejakarta.ejb.EJBContext
-
getCallerPrincipal
- Specified by:
getCallerPrincipalin interfacejakarta.ejb.EJBContext
-
getContextData
- Specified by:
getContextDatain interfacejakarta.ejb.EJBContext- Returns:
- Returns the contextMetaData.
-
isCallerInRole
- Specified by:
isCallerInRolein interfacejakarta.ejb.EJBContext
-
checkAccessToCallerSecurity
Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()- Throws:
IllegalStateException
-
getUserTransaction
- Specified by:
getUserTransactionin interfacejakarta.ejb.EJBContext- Throws:
IllegalStateException
-
setRollbackOnly
- Specified by:
setRollbackOnlyin interfacejakarta.ejb.EJBContext- Throws:
IllegalStateException
-
getRollbackOnly
- Specified by:
getRollbackOnlyin interfacejakarta.ejb.EJBContext- Throws:
IllegalStateException
-
doGetSetRollbackTxAttrCheck
protected void doGetSetRollbackTxAttrCheck() -
getInterceptorInstances
-
checkTimerServiceMethodAccess
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:
checkTimerServiceMethodAccessin interfaceComponentContext- Throws:
IllegalStateException
-
checkActivatePassivate
- Throws:
IllegalStateException
-
inActivatePassivate
protected boolean inActivatePassivate() -
inActivatePassivate
protected boolean inActivatePassivate(org.glassfish.api.invocation.ComponentInvocation inv) -
getKey
-