org.openejb.core.stateful
Class SessionSynchronizationCoordinator

java.lang.Object
  extended by 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: 1096 $ $Date: 2004-03-26 13:41:16 -0800 (Fri, 26 Mar 2004) $
Author:
David Blevins, Richard Monson-Haefel

Field Summary
static Logger 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 static Logger 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
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
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


Copyright © 1999-2011 OpenEJB. All Rights Reserved.