com.sun.ejb.containers
Class SessionContextImpl

java.lang.Object
  extended by com.sun.ejb.containers.EJBContextImpl
      extended by com.sun.ejb.containers.AbstractSessionContextImpl
          extended by com.sun.ejb.containers.SessionContextImpl
All Implemented Interfaces:
ComponentContext, StatefulEJBContext, java.io.Serializable, EJBContext, SessionContext, ResourceHandler

public final class SessionContextImpl
extends AbstractSessionContextImpl
implements StatefulEJBContext

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
 
Fields inherited from class com.sun.ejb.containers.AbstractSessionContextImpl
ejbName, instanceKey
 
Fields inherited from class com.sun.ejb.containers.EJBContextImpl
container, ejbLocalBusinessObjectImpl, ejbLocalObjectImpl, ejbObjectImpl, ejbRemoteBusinessObjectImpl, ejbStub, inEjbRemove, isLocalInterfaceSupported, isRemoteInterfaceSupported, jcdiInjectionContext, optionalEjbLocalBusinessObjectImpl, state, transaction
 
Method Summary
 void addExtendedEntityManagerMapping(javax.persistence.EntityManagerFactory emf, com.sun.ejb.containers.StatefulSessionContainer.EEMRefInfo refInfo)
           
 boolean canBePassivated()
           
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.
 void decrementRefCount()
           
 boolean existsInStore()
           
 javax.persistence.EntityManager getExtendedEntityManager(javax.persistence.EntityManagerFactory emf)
           
 java.util.Map<javax.persistence.EntityManagerFactory,javax.persistence.EntityManager> getExtendedEntityManagerMap()
           
 java.util.Collection<javax.persistence.EntityManager> getExtendedEntityManagers()
           
 long getLastAccessTime()
           
 int getRefCount()
           
 SessionContext getSessionContext()
           
 java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock getStatefulWriteLock()
           
 TimerService getTimerService()
           
 long getVersion()
           
 boolean hasExtendedPC()
           
 long incrementAndGetVersion()
           
 void incrementRefCount()
           
 void initializeStatefulWriteLock()
           
 boolean isEmfRegisteredWithTx(javax.persistence.EntityManagerFactory emf)
           
 void setEmfRegisteredWithTx(javax.persistence.EntityManagerFactory emf, boolean flag)
           
 void setExistsInStore(boolean val)
           
 void setStatefulWriteLock(SessionContextImpl other)
           
 void setVersion(long newVersion)
           
 
Methods inherited from class com.sun.ejb.containers.AbstractSessionContextImpl
getBusinessObject, getCurrentComponentInvocation, getInstanceKey, getInvokedBusinessInterface, getMessageContext, getUserTransaction, setInstanceKey, toString, 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
 

Method Detail

getExtendedEntityManagerMap

public java.util.Map<javax.persistence.EntityManagerFactory,javax.persistence.EntityManager> getExtendedEntityManagerMap()

addExtendedEntityManagerMapping

public void addExtendedEntityManagerMapping(javax.persistence.EntityManagerFactory emf,
                                            com.sun.ejb.containers.StatefulSessionContainer.EEMRefInfo refInfo)

getExtendedEntityManager

public javax.persistence.EntityManager getExtendedEntityManager(javax.persistence.EntityManagerFactory emf)

getExtendedEntityManagers

public java.util.Collection<javax.persistence.EntityManager> getExtendedEntityManagers()

setEmfRegisteredWithTx

public void setEmfRegisteredWithTx(javax.persistence.EntityManagerFactory emf,
                                   boolean flag)

isEmfRegisteredWithTx

public boolean isEmfRegisteredWithTx(javax.persistence.EntityManagerFactory emf)

initializeStatefulWriteLock

public void initializeStatefulWriteLock()

getStatefulWriteLock

public java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock getStatefulWriteLock()

setStatefulWriteLock

public void setStatefulWriteLock(SessionContextImpl other)

getTimerService

public TimerService getTimerService()
                             throws java.lang.IllegalStateException
Specified by:
getTimerService in interface EJBContext
Overrides:
getTimerService in class AbstractSessionContextImpl
Throws:
java.lang.IllegalStateException

checkAccessToCallerSecurity

protected void checkAccessToCallerSecurity()
                                    throws java.lang.IllegalStateException
Description copied from class: EJBContextImpl
Overridden in containers that allow access to isCallerInRole() and getCallerPrincipal()

Overrides:
checkAccessToCallerSecurity in class AbstractSessionContextImpl
Throws:
java.lang.IllegalStateException

checkTimerServiceMethodAccess

public void checkTimerServiceMethodAccess()
                                   throws java.lang.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 AbstractSessionContextImpl
Throws:
java.lang.IllegalStateException

getVersion

public long getVersion()
Specified by:
getVersion in interface StatefulEJBContext

incrementAndGetVersion

public long incrementAndGetVersion()
Specified by:
incrementAndGetVersion in interface StatefulEJBContext

setVersion

public void setVersion(long newVersion)
Specified by:
setVersion in interface StatefulEJBContext

getLastAccessTime

public long getLastAccessTime()
Specified by:
getLastAccessTime in interface StatefulEJBContext

canBePassivated

public boolean canBePassivated()
Specified by:
canBePassivated in interface StatefulEJBContext

hasExtendedPC

public boolean hasExtendedPC()

getSessionContext

public SessionContext getSessionContext()
Specified by:
getSessionContext in interface StatefulEJBContext

existsInStore

public boolean existsInStore()
Specified by:
existsInStore in interface StatefulEJBContext

setExistsInStore

public void setExistsInStore(boolean val)
Specified by:
setExistsInStore in interface StatefulEJBContext

incrementRefCount

public final void incrementRefCount()

decrementRefCount

public final void decrementRefCount()

getRefCount

public final int getRefCount()


Copyright © 2012 GlassFish Community. All Rights Reserved.