org.jboss.mq.pm
Class TxManager

java.lang.Object
  extended byorg.jboss.mq.pm.TxManager

public class TxManager
extends java.lang.Object

This class allows provides the base for user supplied persistence packages.


Constructor Summary
TxManager(PersistenceManager (src)  pm)
          Create a new TxManager
 
Method Summary
 void addPostCommitTask(Tx (src)  txId, java.lang.Runnable task)
          Add an operation for after a commit
 void addPostRollbackTask(Tx (src)  txId, java.lang.Runnable task)
          Add an operation for after a rollback
 void commitTx(Tx (src)  txId)
          Commit the transaction to the persistent store.
 Tx (src) createTx()
          Create and return a unique transaction id.
 Tx (src) createTx(ConnectionToken (src)  dc, java.lang.Object xid)
          Create and return a unique transaction id.
 Tx (src) getPrepared(ConnectionToken (src)  dc, java.lang.Object xid)
          Return the local transaction id for a distributed transaction id.
 void rollbackTx(Tx (src)  txId)
          Rollback the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TxManager

public TxManager(PersistenceManager (src)  pm)
Create a new TxManager

Parameters:
pm - the persistence manager
Method Detail

getPrepared

public final Tx (src)  getPrepared(ConnectionToken (src)  dc,
                            java.lang.Object xid)
                     throws JMSException (src) 
Return the local transaction id for a distributed transaction id.

Parameters:
dc - the connection
xid - the transaction id
Returns:
The Prepared transaction
Throws:
JMSException (src) - Description of Exception

createTx

public final Tx (src)  createTx()
                  throws JMSException (src) 
Create and return a unique transaction id.

Returns:
the transaction id
Throws:
JMSException (src) - for any error

commitTx

public final void commitTx(Tx (src)  txId)
                    throws JMSException (src) 
Commit the transaction to the persistent store.

Parameters:
txId - the transaction
Throws:
JMSException (src) - for any error

addPostCommitTask

public void addPostCommitTask(Tx (src)  txId,
                              java.lang.Runnable task)
                       throws JMSException (src) 
Add an operation for after a commit

Parameters:
txId - the transaction
task - the task
Throws:
JMSException (src) - for any error

rollbackTx

public void rollbackTx(Tx (src)  txId)
                throws JMSException (src) 
Rollback the transaction.

Parameters:
txId - the transaction
Throws:
JMSException (src) - for any error

addPostRollbackTask

public void addPostRollbackTask(Tx (src)  txId,
                                java.lang.Runnable task)
                         throws JMSException (src) 
Add an operation for after a rollback

Parameters:
txId - the transaction
task - the task
Throws:
JMSException (src) - for any error

createTx

public Tx (src)  createTx(ConnectionToken (src)  dc,
                   java.lang.Object xid)
            throws JMSException (src) 
Create and return a unique transaction id. Given a distributed connection and a transaction id object, allocate a unique local transaction id if the remote id is not already known.

Parameters:
dc - the connection token
xid - the xid
Returns:
the transaction
Throws:
JMSException (src) - for any error