org.objectweb.jonas_ejb.container
Class JSessionContext

java.lang.Object
  extended by org.objectweb.jonas_ejb.container.JContext
      extended by org.objectweb.jonas_ejb.container.JSessionContext
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EJBContext, 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, myinstance, 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
abstract  javax.xml.rpc.handler.MessageContext getMessageContext()
          Obtain a reference to the JAX-RPC MessageContext.
 boolean getRollbackOnly()
          Tests if the transaction has been marked for rollback only.
 void initSessionContext(JSessionSwitch bs)
          Reinit Context for reuse
 boolean isMarkedRemoved()
           
abstract  void setConnectionList(java.util.List conlist)
           
abstract  void setRemoved()
           
 
Methods inherited from class org.objectweb.jonas_ejb.container.JContext
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getState, getTimerService, getUserTransaction, getWorkManager, isCallerInRole, isCallerInRole, setRollbackOnly, setState
 
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, getTimerService, 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.
java.lang.IllegalStateException

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.

getMessageContext

public abstract javax.xml.rpc.handler.MessageContext getMessageContext()
                                                                throws java.lang.IllegalStateException
Obtain a reference to the JAX-RPC MessageContext.

Specified by:
getMessageContext in interface javax.ejb.SessionContext
Returns:
The MessageContext for this web service invocation.
Throws:
java.lang.IllegalStateException - - the instance is in a state that does not allow access to this method.

getRollbackOnly

public boolean getRollbackOnly()
                        throws java.lang.IllegalStateException
Tests if the transaction has been marked for rollback only.

Specified by:
getRollbackOnly in interface javax.ejb.EJBContext
Overrides:
getRollbackOnly in class JContext
Returns:
true if transaction will rollback
Throws:
java.lang.IllegalStateException - if state is 0

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
Throws:
java.rmi.RemoteException
javax.ejb.RemoveException

setConnectionList

public abstract void setConnectionList(java.util.List conlist)