activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r417391 - in /incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool: AbstractJmsClient.java AbstractJmsClientSystem.java properties/ReflectionUtil.java
Date Tue, 27 Jun 2006 09:48:01 GMT
Author: aco
Date: Tue Jun 27 02:48:00 2006
New Revision: 417391

URL: http://svn.apache.org/viewvc?rev=417391&view=rev
Log:
Fix the setting of the connection metadata

Modified:
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClient.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClientSystem.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.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=417391&r1=417390&r2=417391&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
Tue Jun 27 02:48:00 2006
@@ -79,27 +79,8 @@
     public Connection getConnection() throws JMSException {
         if (jmsConnection == null) {
             jmsConnection = factory.createConnection();
-
-            // Get Connection Metadata
-            getClient().setJmsProvider(jmsConnection.getMetaData().getJMSProviderName() +
" " + jmsConnection.getMetaData().getProviderVersion());
-            getClient().setJmsVersion("JMS " + jmsConnection.getMetaData().getJMSVersion());
-
-            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("Creating JMS Connection: Provider=" + getClient().getJmsProvider()
+ ", JMS Spec=" + getClient().getJmsVersion());
         }
-
-        log.info("Using JMS Connection:" +
-                " Provider=" + getClient().getJmsProvider() +
-                ", JMS Spec=" + getClient().getJmsVersion() +
-                ", JMS Properties=" + getClient().getJmsProperties());
         return jmsConnection;
     }
 

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClientSystem.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClientSystem.java?rev=417391&r1=417390&r2=417391&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClientSystem.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/AbstractJmsClientSystem.java
Tue Jun 27 02:48:00 2006
@@ -32,7 +32,9 @@
 
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
+import javax.jms.ConnectionMetaData;
 import java.util.Properties;
+import java.util.Enumeration;
 import java.io.IOException;
 
 public abstract class AbstractJmsClientSystem extends AbstractObjectProperties {
@@ -52,6 +54,8 @@
         // Create connection factory
         jmsConnFactory = loadJmsFactory(getSysTest().getSpiClass(), factory.getFactorySettings());
 
+        setProviderMetaData(jmsConnFactory.createConnection().getMetaData(), getJmsClientProperties());
+
         // Create performance sampler
         PerformanceReportWriter writer = createPerfWriter();
         tpSampler.setPerfReportWriter(writer);
@@ -204,6 +208,22 @@
             e.printStackTrace();
             throw new JMSException(e.getMessage());
         }
+    }
+
+    protected void setProviderMetaData(ConnectionMetaData metaData, JmsClientProperties props)
throws JMSException {
+        props.setJmsProvider(metaData.getJMSProviderName() + "-" + metaData.getProviderVersion());
+        props.setJmsVersion(metaData.getJMSVersion());
+
+        String jmsProperties = "";
+        Enumeration jmsProps = metaData.getJMSXPropertyNames();
+        while (jmsProps.hasMoreElements()) {
+            jmsProperties += (jmsProps.nextElement().toString() + ",");
+        }
+        if (jmsProperties.length() > 0) {
+            // Remove the last comma
+            jmsProperties = jmsProperties.substring(0, jmsProperties.length()-1);
+        }
+        props.setJmsProperties(jmsProperties);
     }
 
     protected abstract void runJmsClient(String clientName, int clientDestIndex, int clientDestCount);

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java?rev=417391&r1=417390&r2=417391&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java
Tue Jun 27 02:48:00 2006
@@ -23,7 +23,6 @@
 import java.util.Properties;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Arrays;
 import java.lang.reflect.Method;
 import java.lang.reflect.Field;



Mime
View raw message