[jboss-remoting-commits] JBoss Remoting SVN: r3566 - remoting2/branches/2.x/src/main/org/jboss/remoting.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Thu Mar 6 03:08:53 EST 2008


Author: ron.sigal at jboss.com
Date: 2008-03-06 03:08:52 -0500 (Thu, 06 Mar 2008)
New Revision: 3566

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java
Log:
JBREM-764: Added wire version parameter.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java	2008-03-06 08:07:56 UTC (rev 3565)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/AbstractInvoker.java	2008-03-06 08:08:52 UTC (rev 3566)
@@ -65,6 +65,7 @@
    protected String serializationType;
    protected Map configuration = new HashMap();
    protected SocketFactory socketFactory;
+   protected int version;
 
    // Indicates if the serverSocketFactory was generated internally.
    protected boolean socketFactoryCreatedFromSSLParameters;
@@ -120,6 +121,35 @@
       {
          this.setSerializationType(locator.findSerializationType());
       }
+
+      setVersion(Version.getDefaultVersion());
+      Object o = this.configuration.get(Remoting.REMOTING_VERSION);
+      if (o instanceof String)
+      {
+         try
+         {
+            int v = Integer.valueOf((String)o).intValue();
+            if (Version.isValidVersion(v))
+            {
+               log.debug(this + " setting version to " + v);
+               setVersion(v);
+            }
+            else
+            {
+               log.debug(this + " invalid version: " + v + ". Using " + getVersion());
+            }
+         }
+         catch (Exception e)
+         {
+            log.warn(this + " could not convert " + Remoting.REMOTING_VERSION +
+                     " value of " + o + " to an int value. Using " + getVersion());
+         }
+      }
+      else if (o != null)
+      {
+         log.warn(this + " value of " + Remoting.REMOTING_VERSION +
+                  " must be a String: " + o + ". Using " + getVersion());  
+      }
    }
 
    /**
@@ -282,6 +312,16 @@
       return socketFactoryCreatedFromSSLParameters;
    }
 
+   public int getVersion()
+   {
+      return version;
+   }
+
+   public void setVersion(int version)
+   {
+      this.version = version;
+   }
+
    /**
     * If any configuration parameters relate to the construction of a SSLSocketBuilder, create one.
     */




More information about the jboss-remoting-commits mailing list