activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r416598 - /incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java
Date Fri, 23 Jun 2006 07:48:01 GMT
Author: aco
Date: Fri Jun 23 00:48:01 2006
New Revision: 416598

URL: http://svn.apache.org/viewvc?rev=416598&view=rev
Log:
- Beautify the format of the connection metadata

Modified:
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java?rev=416598&r1=416597&r2=416598&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java
Fri Jun 23 00:48:01 2006
@@ -25,6 +25,7 @@
 import javax.jms.Session;
 import javax.jms.JMSException;
 import javax.jms.Destination;
+import java.util.Enumeration;
 
 public abstract class AbstractJmsClient {
     private static final Log log = LogFactory.getLog(AbstractJmsClient.class);
@@ -79,15 +80,26 @@
         if (jmsConnection == null) {
             jmsConnection = factory.createConnection();
 
-            getClient().setJmsProvider(jmsConnection.getMetaData().getJMSProviderName() +
jmsConnection.getMetaData().getProviderVersion());
+            // Get Connection Metadata
+            getClient().setJmsProvider(jmsConnection.getMetaData().getJMSProviderName() +
" " + jmsConnection.getMetaData().getProviderVersion());
             getClient().setJmsVersion("JMS " + jmsConnection.getMetaData().getJMSVersion());
-            getClient().setJmsProperties(jmsConnection.getMetaData().getJMSXPropertyNames().toString());
+
+            String jmsProperties = "";
+            Enumeration props = jmsConnection.getMetaData().getJMSXPropertyNames();
+            while (props.hasMoreElements()) {
+                jmsProperties += (props.nextElement().toString() + ",");
+            }
+            if (jmsProperties.length() > 0) {
+                // Remove the last comma
+                jmsProperties = jmsProperties.substring(0, jmsProperties.length()-1);
+            }
+            getClient().setJmsProperties(jmsProperties);
         }
 
         log.info("Using JMS Connection:" +
                 " Provider=" + getClient().getJmsProvider() +
-                " JMS Spec=" + getClient().getJmsVersion() +
-                " JMS Properties=" + getClient().getJmsProperties());
+                ", JMS Spec=" + getClient().getJmsVersion() +
+                ", JMS Properties=" + getClient().getJmsProperties());
         return jmsConnection;
     }
 



Mime
View raw message