站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 connector API Documentation 英文版文档

TransactionSynchronizer (JBoss Connector API) - JBoss 4.0.1 sp1 connector API Documentation 英文版文档


org.jboss.resource.connectionmanager
Class TransactionSynchronizer

java.lang.Object
  extended byorg.jboss.resource.connectionmanager.TransactionSynchronizer
All Implemented Interfaces:
Synchronization

public class TransactionSynchronizer
extends Object
implements Synchronization

Organizes transaction synchronization done by JCA.

This class exists to make sure all TxRemover synchronizations are invoked before the cached connection manager closes any closed connections.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Field Summary
protected  Synchronization ccmSynch
          The cached connection manager synchronization
protected  Transaction tx
          The transaction
protected  ArrayList txRemoverSynchs
          TxRemover synchronizations
protected static org.jboss.tm.TransactionLocal txSynchs
          The transaction synchronizations
 
Method Summary
 void afterCompletion(int status)
           
 void beforeCompletion()
           
static Synchronization getCCMSynchronization(Transaction tx)
          Check whether we have a CCM synchronization
protected static TransactionSynchronizer getRegisteredSynchronizer(Transaction tx)
          Get a registered transaction synchronizer.
protected  void invokeAfter(Synchronization synch, int status)
          Invoke an afterCompletion
protected  void invokeBefore(Synchronization synch)
          Invoke a beforeCompletion
static void registerCCMSynchronization(Transaction tx, Synchronization synch)
          Register a new CCM synchronization
static void registerTxRemoverSynchronization(Transaction tx, Synchronization synch)
          Register a new TxRemover synchronization
static void setTransactionManager(TransactionManager tm)
          Initialization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

txSynchs

protected static org.jboss.tm.TransactionLocal txSynchs
The transaction synchronizations


tx

protected Transaction tx
The transaction


txRemoverSynchs

protected ArrayList txRemoverSynchs
TxRemover synchronizations


ccmSynch

protected Synchronization ccmSynch
The cached connection manager synchronization

Method Detail

setTransactionManager

public static void setTransactionManager(TransactionManager tm)
Initialization


registerTxRemoverSynchronization

public static void registerTxRemoverSynchronization(Transaction tx,
                                                    Synchronization synch)
                                             throws RollbackException,
                                                    SystemException
Register a new TxRemover synchronization

Parameters:
tx - the transaction
synch - the synchronization
Throws:
RolledbackException - if the transaction is already rolled back
SystemException - for an error in the tranaction manager
RollbackException

getCCMSynchronization

public static Synchronization getCCMSynchronization(Transaction tx)
Check whether we have a CCM synchronization

Parameters:
tx - the transaction

registerCCMSynchronization

public static void registerCCMSynchronization(Transaction tx,
                                              Synchronization synch)
                                       throws RollbackException,
                                              SystemException
Register a new CCM synchronization

Parameters:
tx - the transaction
synch - the synchronization
Throws:
RolledbackException - if the transaction is already rolled back
SystemException - for an error in the tranaction manager
RollbackException

beforeCompletion

public void beforeCompletion()
Specified by:
beforeCompletion in interface Synchronization

afterCompletion

public void afterCompletion(int status)
Specified by:
afterCompletion in interface Synchronization

invokeBefore

protected void invokeBefore(Synchronization synch)
Invoke a beforeCompletion

Parameters:
synch - the synchronization

invokeAfter

protected void invokeAfter(Synchronization synch,
                           int status)
Invoke an afterCompletion

Parameters:
synch - the synchronization
status - the status of the transaction

getRegisteredSynchronizer

protected static TransactionSynchronizer getRegisteredSynchronizer(Transaction tx)
                                                            throws RollbackException,
                                                                   SystemException
Get a registered transaction synchronizer.

Parameters:
tx - the transaction
Returns:
the registered transaction synchronizer for this transaction
Throws:
RolledbackException - if the transaction is already rolled back
SystemException - for an error in the tranaction manager
RollbackException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.