tyrex.tm
Interface TransactionInterceptor


public interface TransactionInterceptor

The interceptor interface allows an external engine to hook up into the transaction monitor and either record the outcome of transactions or affect them.

The interceptor is notified when transactions are created, attempt to commit, rolled back, and when they are resumed or suspended from threads.

The interceptor may affect the outcome of an attempt to commit or resume a transaction.

The interceptor is notified of the outcome of each transaction in the form of a heuristic decision made regarding the transaction and all it's resources.

Version:
$Revision: 1.3 $ $Date: 2001/03/12 19:20:19 $
Author:
Assaf Arkin

Method Summary
 void begin(javax.transaction.xa.Xid xid)
          Called to indicate that a transaction has begun.
 void commit(javax.transaction.xa.Xid xid)
          Called to indicate that a transaction has been asked to commit.
 void completed(javax.transaction.xa.Xid xid, int heuristic)
          Called to indicate that a heuristic decision has been made regarding this transaction and the outcome of such a decision.
 void resume(javax.transaction.xa.Xid xid, java.lang.Thread thread)
          Called to indicate that a transaction is been resumed in the specified thread.
 void rollback(javax.transaction.xa.Xid xid)
          Called to indicate that a transaction has been asked to rollback.
 void suspend(javax.transaction.xa.Xid xid, java.lang.Thread thread)
          Called to indicate that a transaction has been suspended from the specified thread, and the thread is no longer associated with the transaction.
 

Method Detail

begin

public void begin(javax.transaction.xa.Xid xid)
Called to indicate that a transaction has begun. The transactions's identifier is provided.


commit

public void commit(javax.transaction.xa.Xid xid)
            throws javax.transaction.RollbackException
Called to indicate that a transaction has been asked to commit. Called prior to committing the transaction, and the outcome of this method call might affect the result. If the method throws a RollbackException or marks the transaction for rollback, the transaction will not commit.

Parameters:
xid - The transaction identifier
Throws:
javax.transaction.RollbackException - Thrown to indicate that the transaction must not commit

rollback

public void rollback(javax.transaction.xa.Xid xid)
Called to indicate that a transaction has been asked to rollback. Called prior to rolling back the transaction. All exceptions are ignored.

Parameters:
xid - The transaction identifier

completed

public void completed(javax.transaction.xa.Xid xid,
                      int heuristic)
Called to indicate that a heuristic decision has been made regarding this transaction and the outcome of such a decision. Called after the transaction had been completed and prior to forgetting about the transaction.

Parameters:
xid - The transaction identifier
heuristic - The heuristic decision

resume

public void resume(javax.transaction.xa.Xid xid,
                   java.lang.Thread thread)
            throws javax.transaction.InvalidTransactionException
Called to indicate that a transaction is been resumed in the specified thread. The thread is now associated with the transaction. May affect the outcome of this operation by throwing a InvalidTransactionException to prevent the thread from resuming.

Parameters:
xid - The transaction identifier
thread - The associated thread
Throws:
javax.transaction.InvalidTransactionException - Prevents the thread from being associated with this transaction

suspend

public void suspend(javax.transaction.xa.Xid xid,
                    java.lang.Thread thread)
Called to indicate that a transaction has been suspended from the specified thread, and the thread is no longer associated with the transaction.

Parameters:
xid - The transaction identifier
thread - The associated thread


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.