[jboss-cvs] JBoss Messaging SVN: r8382 - in branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026: src/main/org/jboss/jms/client and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 7 08:44:45 EDT 2011


Author: jbertram
Date: 2011-07-07 08:44:44 -0400 (Thu, 07 Jul 2011)
New Revision: 8382

Added:
   branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/client/ConnectionCapabilities.java
Modified:
   branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/
   branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/ClientTransaction.java
   branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/TransactionRequest.java
   branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/wireformat/ConnectionSendTransactionRequest.java
Log:
SOA-3026


Property changes on: branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/Branch_1_4:7883-7884,7887-7892,7900,7906,7912-7914,7916,7930-7934,7936-7937,7941-7944,7962-7964,7966,7968-7971,7978-7979,7996,7999,8013,8060,8083,8114,8133-8134,8138,8141-8142,8154-8155,8157-8158,8160,8233-8234,8236,8256,8312-8313,8318,8323,8333,8356,8360-8361
/branches/JBM1842:8169-8232
   + /branches/Branch_1_4:7883-7884,7887-7892,7900,7906,7912-7914,7916,7930-7934,7936-7937,7941-7944,7962-7964,7966,7968-7971,7978-7979,7996,7999,8013,8060,8083,8114,8133-8134,8138,8141-8142,8154-8155,8157-8158,8160,8233-8234,8236,8256,8312-8313,8318,8323,8333,8356,8360-8361,8380-8381
/branches/JBM1842:8169-8232

Copied: branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/client/ConnectionCapabilities.java (from rev 8381, branches/Branch_1_4/src/main/org/jboss/jms/client/ConnectionCapabilities.java)
===================================================================
--- branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/client/ConnectionCapabilities.java	                        (rev 0)
+++ branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/client/ConnectionCapabilities.java	2011-07-07 12:44:44 UTC (rev 8382)
@@ -0,0 +1,58 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.jms.client;
+
+/**
+ * Information about server capabilities.
+ */
+public class ConnectionCapabilities
+{
+   // Constants -----------------------------------------------------
+
+   public static final byte RECOVERY_ROLLBACK_VERSION = 39 ;
+   
+   // Attributes ----------------------------------------------------
+   
+   // Static --------------------------------------------------------
+   
+   // Constructors --------------------------------------------------
+   
+   // Connection implementation --------------------------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   public static boolean doesConnectionSupportRecoveryRollback(final byte version)
+   {
+      return (version >= RECOVERY_ROLLBACK_VERSION) ;
+   }
+   
+   // Object overrides ----------------------------------------------
+
+   // Package protected ---------------------------------------------
+   
+   // Protected -----------------------------------------------------
+   
+   // Private -------------------------------------------------------
+   
+   // Inner classes -------------------------------------------------
+  
+}

Modified: branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/ClientTransaction.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/ClientTransaction.java	2011-07-06 21:14:43 UTC (rev 8381)
+++ branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/ClientTransaction.java	2011-07-07 12:44:44 UTC (rev 8382)
@@ -68,6 +68,9 @@
    
    private boolean rollbackOnly = false;
 
+   /* Not sent over the wire, this is for differentiating between incompatible versions */
+   protected boolean supportsRecovered ;
+
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
@@ -235,7 +238,16 @@
       recovered = b;
    }
 
+   public void setSupportsRecovered(final boolean supportsRecovered)
+   {
+      this.supportsRecovered = supportsRecovered ;
+   }
 
+   public boolean getSupportsRecovered()
+   {
+      return supportsRecovered ;
+   }
+
    // Streamable implementation ---------------------------------
 
    public void write(DataOutputStream out) throws Exception
@@ -293,7 +305,10 @@
             out.writeLong(Long.MIN_VALUE);
          }
       }
-      out.writeBoolean(recovered);
+      if (supportsRecovered)
+      {
+         out.writeBoolean(recovered);
+      }
    }
 
 
@@ -338,7 +353,10 @@
          }
       }
       
-      recovered = in.readBoolean();
+      if (supportsRecovered)
+      {
+         recovered = in.readBoolean();
+      }
    }
 
    // Protected -----------------------------------------------------

Modified: branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/TransactionRequest.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/TransactionRequest.java	2011-07-06 21:14:43 UTC (rev 8381)
+++ branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/tx/TransactionRequest.java	2011-07-07 12:44:44 UTC (rev 8382)
@@ -67,6 +67,9 @@
 
    protected ClientTransaction state;
    
+   /* Not send over the wire, this is for differentiating between incompatible versions of ClientTransaction */
+   protected boolean supportsRecovered ;
+   
    // Static --------------------------------------------------------
    
    // Constructors --------------------------------------------------
@@ -110,6 +113,7 @@
       if (state != null)
       {
          out.write(PRESENT);      
+         state.setSupportsRecovered(supportsRecovered) ;
          state.write(out);
       }
       else
@@ -153,6 +157,7 @@
      else
      {
         state = new ClientTransaction();
+        state.setSupportsRecovered(supportsRecovered) ;
      
         state.read(in);
      }
@@ -175,6 +180,16 @@
       return requestType;
    }
 
+   public void setSupportsRecovered(final boolean supportsRecovered)
+   {
+      this.supportsRecovered = supportsRecovered ;
+   }
+
+   public boolean getSupportsRecovered()
+   {
+      return supportsRecovered ;
+   }
+
    public String toString()
    {
       return "TransactionRequest[" +

Modified: branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/wireformat/ConnectionSendTransactionRequest.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/wireformat/ConnectionSendTransactionRequest.java	2011-07-06 21:14:43 UTC (rev 8381)
+++ branches/Branch_JBossMessaging_1_4_6_GA_SOA-3026/src/main/org/jboss/jms/wireformat/ConnectionSendTransactionRequest.java	2011-07-07 12:44:44 UTC (rev 8382)
@@ -24,6 +24,7 @@
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 
+import org.jboss.jms.client.ConnectionCapabilities;
 import org.jboss.jms.delegate.ConnectionEndpoint;
 import org.jboss.jms.tx.TransactionRequest;
 
@@ -63,6 +64,9 @@
       super.read(is);
       
       req = new TransactionRequest();
+
+      final boolean supportsRecovered = ConnectionCapabilities.doesConnectionSupportRecoveryRollback(version) ;
+      req.setSupportsRecovered(supportsRecovered) ;
       
       req.read(is);
 
@@ -88,6 +92,9 @@
    {
       super.write(os);
       
+      final boolean supportsRecovered = ConnectionCapabilities.doesConnectionSupportRecoveryRollback(version) ;
+      req.setSupportsRecovered(supportsRecovered) ;
+      
       req.write(os); 
 
       os.writeBoolean(checkForDuplicates);



More information about the jboss-cvs-commits mailing list