org.openejb.core.stateful
Class SessionSynchronizationCoordinator

java.lang.Object
  |
  +--org.openejb.core.stateful.SessionSynchronizationCoordinator
All Implemented Interfaces:
javax.transaction.Synchronization

public class SessionSynchronizationCoordinator
extends java.lang.Object
implements javax.transaction.Synchronization

This class manages all the SessionSynchronization instances for a given transaction. The SessionSynchronizationCoordinator registers with the transaction and receives the beforeCompletion and afterCompletion events when the transaction completes. When this object receives the beforeCompletion and afterCompletion events, it invokes the appropriate container-callback on the SessionSynchronization objects registered with this coordinator.

Version:
$Revision: 1.1 $ $Date: 2002/01/21 08:09:03 $

Field Summary
 org.apache.log4j.Category logger
           
 
Constructor Summary
SessionSynchronizationCoordinator()
           
 
Method Summary
 void afterCompletion(int status)
          This method is called by the transaction manager after the transaction is committed or rolled back.
 void beforeCompletion()
          This method is called by the transaction manager prior to the start of the transaction completion process.
protected  void discardInstance(StatefulInstanceManager instanceManager, ThreadContext callContext)
           
protected  javax.transaction.TransactionManager getTxMngr()
           
protected  void markTxRollbackOnly(javax.transaction.Transaction tx)
           
static void registerSessionSynchronization(javax.ejb.SessionSynchronization session, TransactionContext context)
           
protected  void throwExceptionToServer(java.lang.Throwable sysException)
          Throw RemoteException to remote client; throw EJBException to local client.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public org.apache.log4j.Category logger
Constructor Detail

SessionSynchronizationCoordinator

public SessionSynchronizationCoordinator()
Method Detail

registerSessionSynchronization

public static void registerSessionSynchronization(javax.ejb.SessionSynchronization session,
                                                  TransactionContext context)
                                           throws javax.transaction.SystemException,
                                                  javax.transaction.RollbackException

beforeCompletion

public void beforeCompletion()
This method is called by the transaction manager prior to the start of the transaction completion process.
Specified by:
beforeCompletion in interface javax.transaction.Synchronization

afterCompletion

public void afterCompletion(int status)
This method is called by the transaction manager after the transaction is committed or rolled back.
Specified by:
afterCompletion in interface javax.transaction.Synchronization
Parameters:
status - The status of the transaction completion.

discardInstance

protected void discardInstance(StatefulInstanceManager instanceManager,
                               ThreadContext callContext)

markTxRollbackOnly

protected void markTxRollbackOnly(javax.transaction.Transaction tx)
                           throws SystemException

getTxMngr

protected javax.transaction.TransactionManager getTxMngr()

throwExceptionToServer

protected void throwExceptionToServer(java.lang.Throwable sysException)
                               throws ApplicationException
Throw RemoteException to remote client; throw EJBException to local client.
Parameters:
sysException -  
Throws:
ApplicationException -