activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r473167 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq: ActiveMQConnection.java ActiveMQConnectionFactory.java
Date Fri, 10 Nov 2006 02:04:40 GMT
Author: chirino
Date: Thu Nov  9 18:04:40 2006
New Revision: 473167

URL: http://svn.apache.org/viewvc?view=rev&rev=473167
Log:
We should let a client change the client id on a connection even if it was set on the connection
factory.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java?view=diff&rev=473167&r1=473166&r2=473167
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
Thu Nov  9 18:04:40 2006
@@ -360,6 +360,16 @@
         this.userSpecifiedClientID = true;
         ensureConnectionInfoSent();
     }
+    
+    /**
+     * Sets the default client id that the connection will use if explicitly not set with
+     * the setClientId() call.
+     */
+    public void setDefaultClientID(String clientID) throws JMSException {
+        this.info.setClientId(clientID);
+        this.userSpecifiedClientID = true;
+    }
+
 
     /**
      * Gets the metadata for this connection.

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java?view=diff&rev=473167&r1=473166&r2=473167
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnectionFactory.java
Thu Nov  9 18:04:40 2006
@@ -260,7 +260,7 @@
             transport.start();
 
             if( clientID !=null )
-                connection.setClientID(clientID);
+                connection.setDefaultClientID(clientID);
 
             return connection;
         }



Mime
View raw message