com.sun.ejb.containers
Class EJBContextImpl

java.lang.Object
  extended by com.sun.ejb.containers.EJBContextImpl
All Implemented Interfaces:
ComponentContext, Serializable, EJBContext, ResourceHandler
Direct Known Subclasses:
AbstractSessionContextImpl, EntityContextImpl, MessageBeanContextImpl

public abstract class EJBContextImpl
extends Object
implements EJBContext, ComponentContext, Serializable

Implementation of javax.ejb.EJBContext for the J2EE Reference Implementation.

See Also:
Serialized Form

Nested Class Summary
static class EJBContextImpl.BeanState
           
 
Field Summary
protected  BaseContainer container
           
protected  EJBLocalObjectImpl ejbLocalBusinessObjectImpl
           
protected  EJBLocalObjectImpl ejbLocalObjectImpl
           
protected  EJBObjectImpl ejbObjectImpl
           
protected  EJBObjectImpl ejbRemoteBusinessObjectImpl
           
protected  EJBObject ejbStub
           
protected  boolean inEjbRemove
           
protected  boolean isLocalInterfaceSupported
           
protected  boolean isRemoteInterfaceSupported
           
protected  JCDIService.JCDIInjectionContext jcdiInjectionContext
           
protected  EJBLocalObjectImpl optionalEjbLocalBusinessObjectImpl
           
protected  EJBContextImpl.BeanState state
           
protected  Transaction transaction
           
 
Method Summary
protected  void checkAccessToCallerSecurity()
          Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()
protected  void checkActivatePassivate()
           
 void 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.
 void decrementConcurrentInvokeCount()
          Decrement the number of concurrent invocations on this bean (could happen with re-entrant bean).
protected  void doGetSetRollbackTxAttrCheck()
           
 Identity getCallerIdentity()
          Deprecated.  
 Principal getCallerPrincipal()
           
 int getConcurrentInvokeCount()
          Get the number of concurrent invocations on this bean (could happen with re-entrant bean).
 Container getContainer()
          Get the Container instance which created this Context.
 Map<String,Object> getContextData()
           
 Object getEJB()
          Get the EJB instance associated with this context.
 EJBHome getEJBHome()
           
 EJBLocalHome getEJBLocalHome()
           
 EJBLocalObject getEJBLocalObject()
          This is a SessionContext/EntityContext method.
 EJBObject getEJBObject()
          This is a SessionContext/EntityContext method.
 Properties getEnvironment()
           
 Object[] getInterceptorInstances()
           
 long getLastTimeUsed()
           
 List getResourceList()
          Get all the resources associated with the context
 boolean getRollbackOnly()
           
 Transaction getTransaction()
          Get the Transaction object associated with this Context.
 UserTransaction getUserTransaction()
           
protected  boolean inActivatePassivate()
           
protected  boolean inActivatePassivate(ComponentInvocation inv)
           
 void incrementConcurrentInvokeCount()
          Increment the number of concurrent invocations on this bean (could happen with re-entrant bean).
 boolean isCallerInRole(Identity identity)
          Deprecated.  
 boolean isCallerInRole(String roleRef)
           
 Object lookup(String name)
           
 void registerResource(ResourceHandle h)
          Register a resource opened by the EJB instance associated with this Context.
 void setRollbackOnly()
           
 void setTransaction(Transaction tr)
           
 void unregisterResource(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, wait
 
Methods inherited from interface javax.ejb.EJBContext
getTimerService
 

Field Detail

container

protected transient BaseContainer container

transaction

protected transient Transaction transaction

ejbStub

protected transient 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 JCDIService.JCDIInjectionContext jcdiInjectionContext
Method Detail

getTransaction

public 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(Transaction tr)

getLastTimeUsed

public long getLastTimeUsed()

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 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(ResourceHandle h)
Register a resource opened by the EJB instance associated with this Context.


unregisterResource

public void unregisterResource(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 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 EJBObject getEJBObject()
                       throws IllegalStateException
This is a SessionContext/EntityContext method.

Throws:
IllegalStateException

getEJBLocalObject

public EJBLocalObject getEJBLocalObject()
                                 throws IllegalStateException
This is a SessionContext/EntityContext method.

Throws:
IllegalStateException

getEJBHome

public EJBHome getEJBHome()
Specified by:
getEJBHome in interface EJBContext

getEJBLocalHome

public EJBLocalHome getEJBLocalHome()
Specified by:
getEJBLocalHome in interface EJBContext

getEnvironment

public Properties getEnvironment()
Specified by:
getEnvironment in interface EJBContext

getCallerIdentity

public Identity getCallerIdentity()
Deprecated. 

Specified by:
getCallerIdentity in interface EJBContext

lookup

public Object lookup(String name)
Specified by:
lookup in interface EJBContext

getCallerPrincipal

public Principal getCallerPrincipal()
Specified by:
getCallerPrincipal in interface EJBContext

getContextData

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

isCallerInRole

public boolean isCallerInRole(Identity identity)
Deprecated. 

Specified by:
isCallerInRole in interface EJBContext

isCallerInRole

public boolean isCallerInRole(String roleRef)
Specified by:
isCallerInRole in interface EJBContext

checkAccessToCallerSecurity

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

Throws:
IllegalStateException

getUserTransaction

public UserTransaction getUserTransaction()
                                   throws IllegalStateException
Specified by:
getUserTransaction in interface EJBContext
Throws:
IllegalStateException

setRollbackOnly

public void setRollbackOnly()
                     throws IllegalStateException
Specified by:
setRollbackOnly in interface EJBContext
Throws:
IllegalStateException

getRollbackOnly

public boolean getRollbackOnly()
                        throws IllegalStateException
Specified by:
getRollbackOnly in interface 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(ComponentInvocation inv)


Copyright © 2012 GlassFish Community. All Rights Reserved.