[jboss-cvs] JBoss Messaging SVN: r2148 - in branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server: endpoint and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 2 12:00:50 EST 2007


Author: timfox
Date: 2007-02-02 12:00:50 -0500 (Fri, 02 Feb 2007)
New Revision: 2148

Modified:
   branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/ServerPeer.java
   branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
Log:
client id check tweak



Modified: branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/ServerPeer.java	2007-02-02 16:59:10 UTC (rev 2147)
+++ branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/ServerPeer.java	2007-02-02 17:00:50 UTC (rev 2148)
@@ -639,15 +639,18 @@
       // only one client at a time. A JMS provider must prevent concurrently executing clients
       // from using it."
          
-      List conns = connectionManager.getActiveConnections();
-   
-      for(Iterator i = conns.iterator(); i.hasNext(); )
-      {
-         ServerConnectionEndpoint sce = (ServerConnectionEndpoint)i.next();
-         if (clientID != null && clientID.equals(sce.getClientID()))
+      if (clientID != null)
+      {      
+         List conns = connectionManager.getActiveConnections();
+      
+         for(Iterator i = conns.iterator(); i.hasNext(); )
          {
-            throw new InvalidClientIDException(
-               "Client ID '" + clientID + "' already used by " + sce);
+            ServerConnectionEndpoint sce = (ServerConnectionEndpoint)i.next();
+            if (clientID != null && clientID.equals(sce.getClientID()))
+            {
+               throw new InvalidClientIDException(
+                  "Client ID '" + clientID + "' already used by " + sce);
+            }
          }
       }
    }

Modified: branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
===================================================================
--- branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java	2007-02-02 16:59:10 UTC (rev 2147)
+++ branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java	2007-02-02 17:00:50 UTC (rev 2148)
@@ -116,11 +116,11 @@
             if (preconfClientID != null)
             {
                clientID = preconfClientID;
-            }
-            
-            serverPeer.checkClientID(clientID);
+            }                        
          }
-   
+         
+         serverPeer.checkClientID(clientID);
+                     
          // create the corresponding "server-side" connection endpoint and register it with the
          // server peer's ClientManager
          ServerConnectionEndpoint endpoint =




More information about the jboss-cvs-commits mailing list