[jboss-remoting-commits] JBoss Remoting SVN: r4850 - remoting2/branches/2.2/src/main/org/jboss/remoting.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Mon Feb 16 19:50:05 EST 2009


Author: ron.sigal at jboss.com
Date: 2009-02-16 19:50:05 -0500 (Mon, 16 Feb 2009)
New Revision: 4850

Modified:
   remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java
Log:
JBREM-1082: (1) Removed configuration of "numberOfRetries"; (2) createPingConfig() gets "NumberOfCallRetries" from metadata; (3) getParametersFromMap() retrieves value of "validatorPingTimeout".

Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java
===================================================================
--- remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java	2009-01-29 20:50:10 UTC (rev 4849)
+++ remoting2/branches/2.2/src/main/org/jboss/remoting/ConnectionValidator.java	2009-02-17 00:50:05 UTC (rev 4850)
@@ -176,12 +176,6 @@
          {
             localConfig.put("NumberOfCallRetries", o);
          }
-         
-         o = config.get("NumberOfRetries");
-         if (o != null)
-         {
-            localConfig.put("NumberOfRetries", o);
-         }
       }
       
       if (metadata != null)
@@ -202,6 +196,12 @@
                         ". Using default value " + DEFAULT_PING_TIMEOUT);
             }
          }
+         o = config.get("NumberOfCallRetries");
+         if (o != null)
+         {
+            localConfig.put("NumberOfCallRetries", o);
+         }
+
       }
       
       if (localConfig.get(ServerInvoker.TIMEOUT) == null)
@@ -507,6 +507,28 @@
             }
          }
 
+         o = config.get(VALIDATOR_PING_TIMEOUT);
+         if (o != null)
+         {
+            if (o instanceof String)
+            {
+               try 
+               {
+                  pingTimeout = Integer.parseInt((String)o);
+               }
+               catch (Exception e)
+               {
+                  log.warn(this + " could not convert " + VALIDATOR_PING_TIMEOUT +
+                           " value of " + o + " to a long value");
+               }
+            }
+            else
+            {
+               log.warn(this + " could not convert " + VALIDATOR_PING_TIMEOUT +
+                        " value of " + o + " to a long value: must be a String");
+            }
+         }
+         
          o = config.get(TIE_TO_LEASE);
          if (o != null)
          {
@@ -555,11 +577,11 @@
    
    private void start()
    {
+      metadata.put(ServerInvoker.TIMEOUT, Integer.toString(pingTimeout));
       configMap = createPingConfig(client.getConfiguration(), metadata);
-      pingTimeout = Integer.parseInt((String) configMap.get(ServerInvoker.TIMEOUT));
-      log.debug(this + " timeout: " + pingTimeout);
-      log.debug(this + " ping retries: " + configMap.get("NumberOfCallRetries"));
-      log.debug(this + " connection retries: " + configMap.get("NumberOfRetries"));
+      log.debug(this + ": pingPeriod:  " + this.pingPeriod);
+      log.debug(this + ": pingTimeout: " + this.pingTimeout);
+      log.debug(this + ": ping retries: " + configMap.get("NumberOfCallRetries"));
       locator = client.getInvoker().getLocator();
 
       try




More information about the jboss-remoting-commits mailing list