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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEJBContextImpl.BeanState
-
Field Summary
Fields Modifier and Type Field Description protected BaseContainercontainerprotected EJBLocalObjectImplejbLocalBusinessObjectImplprotected EJBLocalObjectImplejbLocalObjectImplprotected EJBObjectImplejbObjectImplprotected EJBObjectImplejbRemoteBusinessObjectImplprotected jakarta.ejb.EJBObjectejbStubprotected booleaninEjbRemoveprotected ContextinitialContextprotected booleanisLocalInterfaceSupportedprotected booleanisRemoteInterfaceSupportedprotected com.sun.enterprise.container.common.spi.JCDIService.JCDIInjectionContextjcdiInjectionContextprotected EJBLocalObjectImploptionalEjbLocalBusinessObjectImplprotected EJBContextImpl.BeanStatestateprotected jakarta.transaction.Transactiontransaction
-
Constructor Summary
Constructors Modifier Constructor Description protectedEJBContextImpl(Object ejb, BaseContainer container)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidcheckAccessToCallerSecurity()Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()protected voidcheckActivatePassivate()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.voiddecrementConcurrentInvokeCount()Decrement the number of concurrent invocations on this bean (could happen with re-entrant bean).protected voiddoGetSetRollbackTxAttrCheck()IdentitygetCallerIdentity()Deprecated.PrincipalgetCallerPrincipal()intgetConcurrentInvokeCount()Get the number of concurrent invocations on this bean (could happen with re-entrant bean).ContainergetContainer()Get the Container instance which created this Context.Map<String,Object>getContextData()ObjectgetEJB()Get the EJB instance associated with this context.jakarta.ejb.EJBHomegetEJBHome()jakarta.ejb.EJBLocalHomegetEJBLocalHome()jakarta.ejb.EJBLocalObjectgetEJBLocalObject()This is a SessionContext/EntityContext method.jakarta.ejb.EJBObjectgetEJBObject()This is a SessionContext/EntityContext method.PropertiesgetEnvironment()Object[]getInterceptorInstances()protected ObjectgetKey()longgetLastTimeUsed()ListgetResourceList()Get all the resources associated with the contextbooleangetRollbackOnly()protected EJBContextImpl.BeanStategetState()jakarta.transaction.TransactiongetTransaction()Get the Transaction object associated with this Context.jakarta.transaction.UserTransactiongetUserTransaction()protected booleaninActivatePassivate()protected booleaninActivatePassivate(org.glassfish.api.invocation.ComponentInvocation inv)voidincrementConcurrentInvokeCount()Increment the number of concurrent invocations on this bean (could happen with re-entrant bean).booleanisCallerInRole(String roleRef)booleanisCallerInRole(Identity identity)Deprecated.Objectlookup(String name)voidregisterResource(com.sun.appserv.connectors.internal.api.ResourceHandle h)Register a resource opened by the EJB instance associated with this Context.voidsetRollbackOnly()voidsetTransaction(jakarta.transaction.Transaction tr)voidtouch()voidunregisterResource(com.sun.appserv.connectors.internal.api.ResourceHandle h)Unregister a resource from this Context.
-
-
-
Field Detail
-
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
-
jcdiInjectionContext
protected transient com.sun.enterprise.container.common.spi.JCDIService.JCDIInjectionContext jcdiInjectionContext
-
-
Constructor Detail
-
EJBContextImpl
protected EJBContextImpl(Object ejb, BaseContainer container)
-
-
Method Detail
-
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
protected EJBContextImpl.BeanState getState()
-
getLastTimeUsed
public long getLastTimeUsed()
-
touch
public void touch()
-
getEJB
public Object getEJB()
Description copied from interface:ComponentContextGet the EJB instance associated with this context.- Specified by:
getEJBin interfaceComponentContext
-
getContainer
public Container 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
public List 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
public jakarta.ejb.EJBObject getEJBObject() throws IllegalStateExceptionThis is a SessionContext/EntityContext method.- Throws:
IllegalStateException
-
getEJBLocalObject
public jakarta.ejb.EJBLocalObject getEJBLocalObject() throws IllegalStateExceptionThis 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
public Properties getEnvironment()
-
getCallerIdentity
public Identity getCallerIdentity()
Deprecated.
-
getCallerPrincipal
public Principal getCallerPrincipal()
- Specified by:
getCallerPrincipalin interfacejakarta.ejb.EJBContext
-
getContextData
public Map<String,Object> getContextData()
- Specified by:
getContextDatain interfacejakarta.ejb.EJBContext- Returns:
- Returns the contextMetaData.
-
isCallerInRole
public boolean isCallerInRole(Identity identity)
Deprecated.
-
isCallerInRole
public boolean isCallerInRole(String roleRef)
- Specified by:
isCallerInRolein interfacejakarta.ejb.EJBContext
-
checkAccessToCallerSecurity
protected void checkAccessToCallerSecurity() throws IllegalStateExceptionOverridden in containers that allow access to isCallerInRole() and getCallerPrincipal()- Throws:
IllegalStateException
-
getUserTransaction
public jakarta.transaction.UserTransaction getUserTransaction() throws IllegalStateException- Specified by:
getUserTransactionin interfacejakarta.ejb.EJBContext- Throws:
IllegalStateException
-
setRollbackOnly
public void setRollbackOnly() throws IllegalStateException- Specified by:
setRollbackOnlyin interfacejakarta.ejb.EJBContext- Throws:
IllegalStateException
-
getRollbackOnly
public boolean getRollbackOnly() throws IllegalStateException- Specified by:
getRollbackOnlyin interfacejakarta.ejb.EJBContext- Throws:
IllegalStateException
-
doGetSetRollbackTxAttrCheck
protected void doGetSetRollbackTxAttrCheck()
-
getInterceptorInstances
public Object[] getInterceptorInstances()
-
checkTimerServiceMethodAccess
public void checkTimerServiceMethodAccess() throws IllegalStateExceptionThe 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
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()
-
-