org.objectweb.jonas_ejb.container
Class JStatefulContext

java.lang.Object
  extended by org.objectweb.jonas_ejb.container.JContext
      extended by org.objectweb.jonas_ejb.container.JSessionContext
          extended by org.objectweb.jonas_ejb.container.JStatefulContext
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EJBContext, javax.ejb.SessionContext, javax.transaction.Synchronization
Direct Known Subclasses:
JRepStatefulContext

public class JStatefulContext
extends JSessionContext
implements javax.transaction.Synchronization

This class extends JSessionContext in case of Stateful Session Bean.

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

Field Summary
 
Fields inherited from class org.objectweb.jonas_ejb.container.JSessionContext
bs, ismarkedremoved
 
Fields inherited from class org.objectweb.jonas_ejb.container.JContext
bf, myinstance, tm
 
Constructor Summary
JStatefulContext(JSessionFactory bf, javax.ejb.SessionBean sb, boolean sync)
          Constructs a JStatefulContext
 
Method Summary
 void afterCompletion(int status)
          The afterCompletion method is called by the transaction manager after the transaction is committed or rolled back.
 void beforeCompletion()
          This beforeCompletion method is called by the transaction manager prior to the start of the transaction completion process.
 javax.xml.rpc.handler.MessageContext getMessageContext()
          Obtain a reference to the JAX-RPC MessageContext.
 javax.ejb.TimerService getTimerService()
          Get access to the EJB Timer Service.
 void setConnectionList(java.util.List conlist)
          Set the connection list for this instance.
 void setInstance(javax.ejb.SessionBean sb)
          set instance.
 void setRemoved()
          set this instance as removed
 
Methods inherited from class org.objectweb.jonas_ejb.container.JSessionContext
getEJBLocalObject, getEJBObject, getInstance, getRollbackOnly, initSessionContext, isMarkedRemoved
 
Methods inherited from class org.objectweb.jonas_ejb.container.JContext
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getState, 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, getUserTransaction, isCallerInRole, isCallerInRole, setRollbackOnly
 

Constructor Detail

JStatefulContext

public JStatefulContext(JSessionFactory bf,
                        javax.ejb.SessionBean sb,
                        boolean sync)
Constructs a JStatefulContext

Parameters:
bf - - the Session Factory
sb - - the Enterprise Bean instance
sync - - True if implements SessionSymchronization.
Method Detail

setInstance

public void setInstance(javax.ejb.SessionBean sb)
set instance. Used for passivation/activation.

Parameters:
sb -

getTimerService

public javax.ejb.TimerService getTimerService()
                                       throws java.lang.IllegalStateException
Get access to the EJB Timer Service.

Specified by:
getTimerService in interface javax.ejb.EJBContext
Specified by:
getTimerService in class JContext
Returns:
the EJB Timer Service
Throws:
java.lang.IllegalStateException - Thrown if the instance is not allowed to use this method

getMessageContext

public 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
Specified by:
getMessageContext in class JSessionContext
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.

beforeCompletion

public void beforeCompletion()
This beforeCompletion method is called by the transaction manager prior to the start of the transaction completion process. This method executes in the transaction context of the calling thread.

Specified by:
beforeCompletion in interface javax.transaction.Synchronization

afterCompletion

public void afterCompletion(int status)
The afterCompletion method is called by the transaction manager after the transaction is committed or rolled back. This method executes without a transaction context.

Specified by:
afterCompletion in interface javax.transaction.Synchronization
Parameters:
status - The status of the transaction completion.

setRemoved

public void setRemoved()
                throws java.rmi.RemoteException,
                       javax.ejb.RemoveException
set this instance as removed

Specified by:
setRemoved in class JSessionContext
Throws:
java.rmi.RemoteException
javax.ejb.RemoveException

setConnectionList

public void setConnectionList(java.util.List conlist)
Set the connection list for this instance.

Specified by:
setConnectionList in class JSessionContext