com.sun.ejb.containers
Class AbstractSessionContextImpl

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

public abstract class AbstractSessionContextImpl
extends EJBContextImpl
implements SessionContext

Implementation of EJBContext for SessionBeans

Author:
Mahesh Kannan
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.ejb.containers.EJBContextImpl
EJBContextImpl.BeanState
 
Field Summary
protected  String ejbName
           
protected  Object instanceKey
           
 
Fields inherited from class com.sun.ejb.containers.EJBContextImpl
container, ejbLocalBusinessObjectImpl, ejbLocalObjectImpl, ejbObjectImpl, ejbRemoteBusinessObjectImpl, ejbStub, inEjbRemove, isLocalInterfaceSupported, isRemoteInterfaceSupported, jcdiInjectionContext, optionalEjbLocalBusinessObjectImpl, state, transaction
 
Constructor Summary
protected AbstractSessionContextImpl(Object ejb, BaseContainer container)
           
 
Method Summary
protected  void checkAccessToCallerSecurity()
          Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()
 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.
<T> T
getBusinessObject(Class<T> businessInterface)
           
protected  ComponentInvocation getCurrentComponentInvocation()
           
 Object getInstanceKey()
           
 Class getInvokedBusinessInterface()
           
 javax.xml.rpc.handler.MessageContext getMessageContext()
           
 TimerService getTimerService()
           
 UserTransaction getUserTransaction()
           
 void setInstanceKey(Object instanceKey)
           
 String toString()
           
 boolean wasCancelCalled()
           
 
Methods inherited from class com.sun.ejb.containers.EJBContextImpl
checkActivatePassivate, decrementConcurrentInvokeCount, doGetSetRollbackTxAttrCheck, getCallerIdentity, getCallerPrincipal, getConcurrentInvokeCount, getContainer, getContextData, getEJB, getEJBHome, getEJBLocalHome, getEJBLocalObject, getEJBObject, getEnvironment, getInterceptorInstances, getLastTimeUsed, getResourceList, getRollbackOnly, getTransaction, inActivatePassivate, inActivatePassivate, incrementConcurrentInvokeCount, isCallerInRole, isCallerInRole, lookup, registerResource, setRollbackOnly, setTransaction, unregisterResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.ejb.SessionContext
getEJBLocalObject, getEJBObject
 
Methods inherited from interface javax.ejb.EJBContext
getCallerIdentity, getCallerPrincipal, getContextData, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, isCallerInRole, isCallerInRole, lookup, setRollbackOnly
 

Field Detail

instanceKey

protected Object instanceKey

ejbName

protected String ejbName
Constructor Detail

AbstractSessionContextImpl

protected AbstractSessionContextImpl(Object ejb,
                                     BaseContainer container)
Method Detail

getInstanceKey

public Object getInstanceKey()

setInstanceKey

public void setInstanceKey(Object instanceKey)

toString

public String toString()
Overrides:
toString in class Object

getTimerService

public TimerService getTimerService()
                             throws IllegalStateException
Specified by:
getTimerService in interface EJBContext
Throws:
IllegalStateException

getUserTransaction

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

getMessageContext

public javax.xml.rpc.handler.MessageContext getMessageContext()
Specified by:
getMessageContext in interface SessionContext

getBusinessObject

public <T> T getBusinessObject(Class<T> businessInterface)
                    throws IllegalStateException
Specified by:
getBusinessObject in interface SessionContext
Throws:
IllegalStateException

getInvokedBusinessInterface

public Class getInvokedBusinessInterface()
                                  throws IllegalStateException
Specified by:
getInvokedBusinessInterface in interface SessionContext
Throws:
IllegalStateException

wasCancelCalled

public boolean wasCancelCalled()
Specified by:
wasCancelCalled in interface SessionContext

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 EJBContextImpl
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 EJBContextImpl
Throws:
IllegalStateException

getCurrentComponentInvocation

protected ComponentInvocation getCurrentComponentInvocation()


Copyright © 2012 GlassFish Community. All Rights Reserved.