[jboss-cvs] JBoss Messaging SVN: r2147 - in trunk/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 11:59:10 EST 2007


Author: timfox
Date: 2007-02-02 11:59:10 -0500 (Fri, 02 Feb 2007)
New Revision: 2147

Modified:
   trunk/src/main/org/jboss/jms/server/ServerPeer.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
Log:
Tweak for client ID check



Modified: trunk/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-02-02 16:53:27 UTC (rev 2146)
+++ trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-02-02 16:59:10 UTC (rev 2147)
@@ -1229,16 +1229,19 @@
       // "By definition, the client state identified by a client identifier can be ‘in use’ by
       // 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: trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java	2007-02-02 16:53:27 UTC (rev 2146)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java	2007-02-02 16:59:10 UTC (rev 2147)
@@ -198,11 +198,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