org.objectweb.jonas_ejb.container
Class JSessionContext

java.lang.Object
  |
  +--org.objectweb.jonas_ejb.container.JContext
        |
        +--org.objectweb.jonas_ejb.container.JSessionContext
All Implemented Interfaces:
javax.ejb.EJBContext, java.io.Serializable, javax.ejb.SessionContext
Direct Known Subclasses:
JStatefulContext, JStatelessContext

public abstract class JSessionContext
extends JContext
implements javax.ejb.SessionContext, java.io.Serializable

This class implements javax.ejb.SessionContext interface. it should be implemented by JStatefulContext and JStatelessContext depending if the beans is stateful or stateless.

Author:
Philippe Coq, Philippe Durieux
See Also:
Serialized Form

Field Summary
protected  JSessionSwitch bs
           
protected  boolean ismarkedremoved
           
 
Fields inherited from class org.objectweb.jonas_ejb.container.JContext
bf, cont, home, instance, localhome, roleGuard, tm
 
Constructor Summary
JSessionContext(JSessionFactory bf, javax.ejb.SessionBean eb)
          Constructs a SessionContext
 
Method Summary
 javax.ejb.EJBLocalObject getEJBLocalObject()
          Obtain a reference to the EJB local object that is currently associated with the instance.
 javax.ejb.EJBObject getEJBObject()
          Obtains a reference to the EJB object that is currently associated with the instance.
 javax.ejb.SessionBean getInstance()
          Returns the bean instance of this context Used in the generated classes to retrieve the instance
 void initSessionContext(JSessionSwitch bs)
          Reinit Context for reuse
 boolean isMarkedRemoved()
           
abstract  void setRemoved()
           
 
Methods inherited from class org.objectweb.jonas_ejb.container.JContext
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getUserTransaction, isCallerInRole, isCallerInRole, setRollbackOnly
 
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
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getUserTransaction, isCallerInRole, isCallerInRole, setRollbackOnly
 

Field Detail

bs

protected JSessionSwitch bs

ismarkedremoved

protected boolean ismarkedremoved
Constructor Detail

JSessionContext

public JSessionContext(JSessionFactory bf,
                       javax.ejb.SessionBean eb)
Constructs a SessionContext
Parameters:
bf - The Session Factory
eb - The Session bean instance
Method Detail

getEJBObject

public javax.ejb.EJBObject getEJBObject()
                                 throws java.lang.IllegalStateException
Obtains a reference to the EJB object that is currently associated with the instance.
Specified by:
getEJBObject in interface javax.ejb.SessionContext
Returns:
The EJB object currently associated with the instance.
Throws:
IllegalStateException: - Thrown if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method.

getEJBLocalObject

public javax.ejb.EJBLocalObject getEJBLocalObject()
                                           throws java.lang.IllegalStateException
Obtain a reference to the EJB local object that is currently associated with the instance.
Specified by:
getEJBLocalObject in interface javax.ejb.SessionContext
Returns:
The EJB local object currently associated with the instance.
Throws:
java.lang.IllegalStateException - - if the instance invokes this method while the instance is in a state that does not allow the instance to invoke this method, or if the instance does not have a local interface.

initSessionContext

public void initSessionContext(JSessionSwitch bs)
Reinit Context for reuse
Parameters:
bs - The SessionSwitch to reuse.

getInstance

public javax.ejb.SessionBean getInstance()
                                  throws java.rmi.RemoteException
Returns the bean instance of this context Used in the generated classes to retrieve the instance
Returns:
the bean instance
Throws:
java.rmi.RemoteException - if no instance

isMarkedRemoved

public boolean isMarkedRemoved()
Returns:
True if bean instance is marked removed.

setRemoved

public abstract void setRemoved()
                         throws java.rmi.RemoteException,
                                javax.ejb.RemoveException