[jboss-cvs] JBoss Messaging SVN: r7912 - in branches/Branch_1_4: integration/EAP4/etc/xmdesc and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 1 08:19:40 EST 2009


Author: gaohoward
Date: 2009-12-01 08:19:40 -0500 (Tue, 01 Dec 2009)
New Revision: 7912

Modified:
   branches/Branch_1_4/integration/AS5/etc/xmdesc/ServerPeer-xmbean.xml
   branches/Branch_1_4/integration/EAP4/etc/xmdesc/ServerPeer-xmbean.xml
   branches/Branch_1_4/integration/EAP5/etc/xmdesc/ServerPeer-xmbean.xml
   branches/Branch_1_4/src/main/org/jboss/jms/server/ServerPeer.java
   branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/tx/TransactionRepository.java
Log:
JBMESSAGING-1772


Modified: branches/Branch_1_4/integration/AS5/etc/xmdesc/ServerPeer-xmbean.xml
===================================================================
--- branches/Branch_1_4/integration/AS5/etc/xmdesc/ServerPeer-xmbean.xml	2009-11-27 02:47:45 UTC (rev 7911)
+++ branches/Branch_1_4/integration/AS5/etc/xmdesc/ServerPeer-xmbean.xml	2009-12-01 13:19:40 UTC (rev 7912)
@@ -445,6 +445,38 @@
    
    <operation>
       <description>
+         list of all prepared transaction ids used for manual commit or rollback
+      </description>
+      <name>listPreparedTransactions</name>
+      <return-type>java.util.List</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
+         Commit a prepared transaction
+      </description>
+      <name>commitPreparedTransaction</name>
+      <parameter>
+         <name>transactionID</name>
+         <type>java.lang.Long</type>
+      </parameter>
+      <return-type>boolean</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
+         Rollback a prepared transaction
+      </description>
+      <name>rollbackPreparedTransaction</name>
+      <parameter>
+         <name>transactionID</name>
+         <type>java.lang.Long</type>
+      </parameter>
+      <return-type>boolean</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
          Show of all prepared transaction ids in HTML
       </description>
       <name>showPreparedTransactionsAsHTML</name>

Modified: branches/Branch_1_4/integration/EAP4/etc/xmdesc/ServerPeer-xmbean.xml
===================================================================
--- branches/Branch_1_4/integration/EAP4/etc/xmdesc/ServerPeer-xmbean.xml	2009-11-27 02:47:45 UTC (rev 7911)
+++ branches/Branch_1_4/integration/EAP4/etc/xmdesc/ServerPeer-xmbean.xml	2009-12-01 13:19:40 UTC (rev 7912)
@@ -441,6 +441,38 @@
    
    <operation>
       <description>
+         list of all prepared transaction ids used for manual commit or rollback
+      </description>
+      <name>listPreparedTransactions</name>
+      <return-type>java.util.List</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
+         Commit a prepared transaction
+      </description>
+      <name>commitPreparedTransaction</name>
+      <parameter>
+         <name>transactionID</name>
+         <type>java.lang.Long</type>
+      </parameter>
+      <return-type>boolean</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
+         Rollback a prepared transaction
+      </description>
+      <name>rollbackPreparedTransaction</name>
+      <parameter>
+         <name>transactionID</name>
+         <type>java.lang.Long</type>
+      </parameter>
+      <return-type>boolean</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
          Show of all prepared transaction ids in HTML
       </description>
       <name>showPreparedTransactionsAsHTML</name>

Modified: branches/Branch_1_4/integration/EAP5/etc/xmdesc/ServerPeer-xmbean.xml
===================================================================
--- branches/Branch_1_4/integration/EAP5/etc/xmdesc/ServerPeer-xmbean.xml	2009-11-27 02:47:45 UTC (rev 7911)
+++ branches/Branch_1_4/integration/EAP5/etc/xmdesc/ServerPeer-xmbean.xml	2009-12-01 13:19:40 UTC (rev 7912)
@@ -445,6 +445,38 @@
    
    <operation>
       <description>
+         list of all prepared transaction ids used for manual commit or rollback
+      </description>
+      <name>listPreparedTransactions</name>
+      <return-type>java.util.List</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
+         Commit a prepared transaction
+      </description>
+      <name>commitPreparedTransaction</name>
+      <parameter>
+         <name>transactionID</name>
+         <type>java.lang.Long</type>
+      </parameter>
+      <return-type>boolean</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
+         Rollback a prepared transaction
+      </description>
+      <name>rollbackPreparedTransaction</name>
+      <parameter>
+         <name>transactionID</name>
+         <type>java.lang.Long</type>
+      </parameter>
+      <return-type>boolean</return-type>
+   </operation>  
+   
+   <operation>
+      <description>
          Show of all prepared transaction ids in HTML
       </description>
       <name>showPreparedTransactionsAsHTML</name>

Modified: branches/Branch_1_4/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/server/ServerPeer.java	2009-11-27 02:47:45 UTC (rev 7911)
+++ branches/Branch_1_4/src/main/org/jboss/jms/server/ServerPeer.java	2009-12-01 13:19:40 UTC (rev 7912)
@@ -1139,6 +1139,21 @@
       return txRepository.getPreparedTransactions();
    }
 
+   public List listPreparedTransactions()
+   {
+      return txRepository.listPreparedTransactions();
+   }
+   
+   public boolean commitPreparedTransaction(Long transactionID)
+   {
+      return txRepository.commitPreparedTransaction(transactionID);
+   }
+   
+   public boolean rollbackPreparedTransaction(Long transactionID)
+   {
+      return txRepository.rollbackPreparedTransaction(transactionID);
+   }
+
    public String showPreparedTransactionsAsHTML()
    {
       List txs = txRepository.getPreparedTransactions();

Modified: branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/tx/TransactionRepository.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/tx/TransactionRepository.java	2009-11-27 02:47:45 UTC (rev 7911)
+++ branches/Branch_1_4/src/main/org/jboss/messaging/core/impl/tx/TransactionRepository.java	2009-12-01 13:19:40 UTC (rev 7912)
@@ -25,6 +25,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.transaction.xa.Xid;
 
@@ -512,4 +513,63 @@
 
    }
 
+   /**
+    * manually commit the prepared transaction
+    */
+   public boolean commitPreparedTransaction(Long txid)
+   {
+      Iterator itv = map.values().iterator();
+      boolean result = false;
+      while (itv.hasNext())
+      {
+         Transaction tx = (Transaction)itv.next();
+         try
+         {
+            tx.commit();
+            result = true;
+         }
+         catch (Exception e)
+         {
+            log.warn("Failed to manually commit transaction " + tx, e);
+         }
+      }
+      return result;
+   }
+
+   /**
+    * manually rollback the prepared transaction
+    */
+   public boolean rollbackPreparedTransaction(Long txid)
+   {
+      Iterator itv = map.values().iterator();
+      boolean result = false;
+      while (itv.hasNext())
+      {
+         Transaction tx = (Transaction)itv.next();
+         try
+         {
+            tx.rollback();
+            result = true;
+         }
+         catch (Exception e)
+         {
+            log.warn("Failed to manually rollback transaction " + tx, e);
+         }
+      }
+      return result;
+   }
+
+   public List listPreparedTransactions()
+   {
+      ArrayList<String> list = new ArrayList<String>(map.size());
+      Iterator itk = map.keySet().iterator();
+      while (itk.hasNext())
+      {
+         Xid txid = (Xid)itk.next();
+         Transaction tx = (Transaction)map.get(txid);
+         list.add(tx.getId() + " : " + txid.toString());
+      }
+      return list;
+   }
+
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list