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
voidbegin(Xid xid)
Called to indicate that a transaction has begun.
voidcommit(Xid xid)
Called to indicate that a transaction has been asked to commit.
voidcompleted(Xid xid, int heuristic)
Called to indicate that a heuristic decision has been made regarding this transaction and the outcome of such a decision.
voidresume(Xid xid, Thread thread)
Called to indicate that a transaction is been resumed in the specified thread.
voidrollback(Xid xid)
Called to indicate that a transaction has been asked to rollback.
voidsuspend(Xid xid, 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(Xid xid)
Called to indicate that a transaction has begun. The transactions's identifier is provided.

Parameters: Xid The transaction identifier

commit

public void commit(Xid xid)
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: RollbackException Thrown to indicate that the transaction must not commit

completed

public void completed(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(Xid xid, Thread thread)
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: InvalidTransactionException Prevents the thread from being associated with this transaction

rollback

public void rollback(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

suspend

public void suspend(Xid xid, 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.