org.jboss.jms.tx
Class ResourceManager

java.lang.Object
  extended byorg.jboss.jms.tx.ResourceManager

public class ResourceManager
extends java.lang.Object

The ResourceManager manages work done in both local and global (XA) transactions. This is one instance of ResourceManager per JMS server. The ResourceManager instances are managed by ResourceManagerFactory.

Version:
$Revision: 1569 $ $Id: ResourceManager.java 1569 2006-11-17 02:08:56Z ovidiu.feodorov@jboss.com $
Author:
Hiram Chirino, Adrian Brock

Field Summary
protected  ConcurrentHashMap transactions
           
 
Constructor Summary
protected ResourceManager()
           
 
Method Summary
 void addAck(java.lang.Object xid, AckInfo ackInfo)
          Add an acknowledgement to the transaction
 void addMessage(java.lang.Object xid, Message m)
          Add a message to a transaction
 void commit(javax.transaction.xa.Xid xid, boolean onePhase, ConnectionDelegate connection)
           
 void commitLocal(LocalTx xid, ConnectionDelegate connection)
           
protected  javax.transaction.xa.Xid convertTx(LocalTx anonXid, javax.transaction.xa.Xid xid)
           
 LocalTx createLocalTx()
          Create a local tx.
protected  void endTx(javax.transaction.xa.Xid xid, boolean success)
           
 TxState getTx(java.lang.Object xid)
           
protected  javax.transaction.xa.Xid joinTx(javax.transaction.xa.Xid xid)
           
protected  int prepare(javax.transaction.xa.Xid xid, ConnectionDelegate connection)
           
protected  javax.transaction.xa.Xid[] recover(int flags, ConnectionDelegate conn)
           
 TxState removeTx(java.lang.Object xid)
           
protected  javax.transaction.xa.Xid resumeTx(javax.transaction.xa.Xid xid)
           
 void rollback(javax.transaction.xa.Xid xid, ConnectionDelegate connection)
           
 void rollbackLocal(LocalTx xid, ConnectionDelegate connection)
           
 int size()
           
protected  javax.transaction.xa.Xid startTx(javax.transaction.xa.Xid xid)
           
protected  javax.transaction.xa.Xid suspendTx(javax.transaction.xa.Xid xid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transactions

protected ConcurrentHashMap transactions
Constructor Detail

ResourceManager

protected ResourceManager()
Method Detail

getTx

public TxState getTx(java.lang.Object xid)

removeTx

public TxState removeTx(java.lang.Object xid)

createLocalTx

public LocalTx createLocalTx()
Create a local tx.


addMessage

public void addMessage(java.lang.Object xid,
                       Message m)
Add a message to a transaction

Parameters:
xid - - The id of the transaction to add the message to
m - The message

addAck

public void addAck(java.lang.Object xid,
                   AckInfo ackInfo)
            throws JMSException
Add an acknowledgement to the transaction

Parameters:
xid - - The id of the transaction to add the message to
ackInfo - Information describing the acknowledgement
Throws:
JMSException

commitLocal

public void commitLocal(LocalTx xid,
                        ConnectionDelegate connection)
                 throws JMSException
Throws:
JMSException

rollbackLocal

public void rollbackLocal(LocalTx xid,
                          ConnectionDelegate connection)
                   throws JMSException
Throws:
JMSException

commit

public void commit(javax.transaction.xa.Xid xid,
                   boolean onePhase,
                   ConnectionDelegate connection)
            throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

rollback

public void rollback(javax.transaction.xa.Xid xid,
                     ConnectionDelegate connection)
              throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

size

public int size()

endTx

protected void endTx(javax.transaction.xa.Xid xid,
                     boolean success)
              throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

joinTx

protected javax.transaction.xa.Xid joinTx(javax.transaction.xa.Xid xid)
                                   throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

prepare

protected int prepare(javax.transaction.xa.Xid xid,
                      ConnectionDelegate connection)
               throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

resumeTx

protected javax.transaction.xa.Xid resumeTx(javax.transaction.xa.Xid xid)
                                     throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

suspendTx

protected javax.transaction.xa.Xid suspendTx(javax.transaction.xa.Xid xid)
                                      throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

convertTx

protected javax.transaction.xa.Xid convertTx(LocalTx anonXid,
                                             javax.transaction.xa.Xid xid)
                                      throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

startTx

protected javax.transaction.xa.Xid startTx(javax.transaction.xa.Xid xid)
                                    throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException

recover

protected javax.transaction.xa.Xid[] recover(int flags,
                                             ConnectionDelegate conn)
                                      throws javax.transaction.xa.XAException
Throws:
javax.transaction.xa.XAException


Copyright © 2006 JBoss Inc. All Rights Reserved.