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

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed May 21 23:25:10 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-05-21 23:25:10 -0400 (Wed, 21 May 2008)
New Revision: 4207

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
Log:
JBREM-982: In invoke() make a single test if payload is a String before testing for internal actions.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java	2008-05-22 03:21:34 UTC (rev 4206)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvoker.java	2008-05-22 03:25:10 UTC (rev 4207)
@@ -731,60 +731,63 @@
          {
             return ECHO;
          }
-         
-         // check to see if this is a is alive ping
-         if ("$PING$".equals(param))
+
+         if (param instanceof String)
          {
-            Map metadata = invocation.getRequestPayload();
-            if (metadata != null)
+            // check to see if this is a is alive ping
+            if ("$PING$".equals(param))
             {
-               String invokerSessionId = (String) metadata.get(INVOKER_SESSION_ID);
-               if (invokerSessionId != null)
+               Map metadata = invocation.getRequestPayload();
+               if (metadata != null)
                {
-                  // Comes from ConnectionValidator configured to tie validation with lease.
-                  boolean response = checkForClientLease(invokerSessionId);
-                  if (trace) log.trace(this + " responding " + response + " to $PING$ for invoker sessionId " + invokerSessionId);
-                  return new Boolean(response);
+                  String invokerSessionId = (String) metadata.get(INVOKER_SESSION_ID);
+                  if (invokerSessionId != null)
+                  {
+                     // Comes from ConnectionValidator configured to tie validation with lease.
+                     boolean response = checkForClientLease(invokerSessionId);
+                     if (trace) log.trace(this + " responding " + response + " to $PING$ for invoker sessionId " + invokerSessionId);
+                     return new Boolean(response);
+                  }
                }
-            }
-            
-            if (leaseManagement)
-            {
-               // Otherwise, it's a normal PING.  NOTE we only update the lease when we
-               // receive a PING, not for all invocations.
-               updateClientLease(invocation);
-            }
 
-            // if this is an invocation ping, just pong back
-            Map responseMap = new HashMap();
-            responseMap.put(CLIENT_LEASE_PERIOD, new Long(leasePeriod));
+               if (leaseManagement)
+               {
+                  // Otherwise, it's a normal PING.  NOTE we only update the lease when we
+                  // receive a PING, not for all invocations.
+                  updateClientLease(invocation);
+               }
 
-            InvocationResponse ir = new InvocationResponse(invocation.getSessionId(),
-                                                           new Boolean(leaseManagement),
-                                                           false, responseMap);
+               // if this is an invocation ping, just pong back
+               Map responseMap = new HashMap();
+               responseMap.put(CLIENT_LEASE_PERIOD, new Long(leasePeriod));
 
-            if (trace) { log.trace(this + " returning " + ir); }
-            return ir;
-         }
+               InvocationResponse ir = new InvocationResponse(invocation.getSessionId(),
+                     new Boolean(leaseManagement),
+                     false, responseMap);
 
-         if ("$GET_CLIENT_LOCAL_ADDRESS$".equals(param))
-         {
-            InetAddress address = null;
-            if (invocation.getRequestPayload() != null)
-               address = (InetAddress) invocation.getRequestPayload().get(Remoting.CLIENT_ADDRESS);
-            
-             return address;
-         }
+               if (trace) { log.trace(this + " returning " + ir); }
+               return ir;
+            }
 
-         if ("$DISCONNECT$".equals(param))
-         {
-            if (leaseManagement)
+            if ("$GET_CLIENT_LOCAL_ADDRESS$".equals(param))
             {
-               terminateLease(invocation);
+               InetAddress address = null;
+               if (invocation.getRequestPayload() != null)
+                  address = (InetAddress) invocation.getRequestPayload().get(Remoting.CLIENT_ADDRESS);
+
+               return address;
             }
 
-            if (trace) { log.trace(this + " returning null"); }
-            return null;
+            if ("$DISCONNECT$".equals(param))
+            {
+               if (leaseManagement)
+               {
+                  terminateLease(invocation);
+               }
+
+               if (trace) { log.trace(this + " returning null"); }
+               return null;
+            }
          }
 
          //TODO: -TME both oneway and internal invocation will be broken since have not
@@ -1042,7 +1045,7 @@
       {
          try
          {
-            maxOnewayThreadPoolQueueSize = Integer.parseInt(param);
+            maxOnewayThreadPoolQueueSize = Integer.parseInt((String) param);
          }
          catch (NumberFormatException  e)
          {




More information about the jboss-remoting-commits mailing list