You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2006/12/29 19:37:35 UTC

svn commit: r491072 - in /incubator/qpid/trunk/qpid/java/perftests: ./ bin/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/qpid/ src/main/java/org/apache/qpid/config/ src/main/java/org/apache/qpid/to...

Author: rgreig
Date: Fri Dec 29 10:37:34 2006
New Revision: 491072

URL: http://svn.apache.org/viewvc?view=rev&rev=491072
Log:
QPID-232 Created a simple module and added the topic test

Added:
    incubator/qpid/trunk/qpid/java/perftests/
    incubator/qpid/trunk/qpid/java/perftests/bin/
    incubator/qpid/trunk/qpid/java/perftests/bin/run_many.sh   (with props)
    incubator/qpid/trunk/qpid/java/perftests/bin/setupclasspath.sh   (with props)
    incubator/qpid/trunk/qpid/java/perftests/bin/topicListener.sh   (with props)
    incubator/qpid/trunk/qpid/java/perftests/bin/topicPublisher.sh   (with props)
    incubator/qpid/trunk/qpid/java/perftests/pom.xml   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/
    incubator/qpid/trunk/qpid/java/perftests/src/main/
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java   (with props)
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java   (with props)

Added: incubator/qpid/trunk/qpid/java/perftests/bin/run_many.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/run_many.sh?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/run_many.sh (added)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/run_many.sh Fri Dec 29 10:37:34 2006
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+
+# args: 
+# <number of processes to start>
+# <name of run>
+# <command ro run>
+
+for i in `seq 1 $1`; do
+    $3 >$2.$i.out 2>>$2.err &
+    echo $! > $2.$i.pid
+done;

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/run_many.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/run_many.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/perftests/bin/setupclasspath.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/setupclasspath.sh?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/setupclasspath.sh (added)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/setupclasspath.sh Fri Dec 29 10:37:34 2006
@@ -0,0 +1,9 @@
+if [ -z $QPID_HOME ] ; then
+    echo "QPID_HOME must be set"
+    exit
+fi
+CP=$QPID_HOME/lib/qpid-incubating.jar:../target/classes
+
+if [ `uname -o` == "Cygwin" ] ; then
+     CP=`cygpath --path --windows $CP`
+fi

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/setupclasspath.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/setupclasspath.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/perftests/bin/topicListener.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/topicListener.sh?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/topicListener.sh (added)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/topicListener.sh Fri Dec 29 10:37:34 2006
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+
+# XXX -Xmx512m -Xms512m -XX:NewSize=150m
+. ./setupclasspath.sh
+echo $CP
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="INFO" org.apache.qpid.topic.Listener $*

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/topicListener.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/topicListener.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/perftests/bin/topicPublisher.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/topicPublisher.sh?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/topicPublisher.sh (added)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/topicPublisher.sh Fri Dec 29 10:37:34 2006
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# XXX -Xmx512m -Xms512m -XX:NewSize=150m
+. ./setupclasspath.sh
+$JAVA_HOME/bin/java -cp $CP  -Damqj.logging.level="INFO" org.apache.qpid.topic.Publisher $*

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/topicPublisher.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/perftests/bin/topicPublisher.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/perftests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/pom.xml?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/pom.xml (added)
+++ incubator/qpid/trunk/qpid/java/perftests/pom.xml Fri Dec 29 10:37:34 2006
@@ -0,0 +1,55 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.qpid</groupId>
+    <artifactId>qpid-perftests</artifactId>
+    <packaging>jar</packaging>
+    <version>1.0-incubating-M2-SNAPSHOT</version>
+    <name>Qpid Performance Tests</name>
+    <url>http://cwiki.apache.org/confluence/display/qpid</url>
+
+    <parent>
+        <groupId>org.apache.qpid</groupId>
+        <artifactId>qpid</artifactId>
+        <version>1.0-incubating-M2-SNAPSHOT</version>
+    </parent>
+
+    <properties>
+        <topDirectoryLocation>..</topDirectoryLocation>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.qpid</groupId>
+            <artifactId>qpid-client</artifactId>
+        </dependency>
+    </dependencies>
+
+<!--    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>-->
+</project>

Propchange: incubator/qpid/trunk/qpid/java/perftests/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.config;
+
+import org.apache.qpid.client.AMQConnectionFactory;
+import org.apache.qpid.config.ConnectionFactoryInitialiser;
+import org.apache.qpid.config.ConnectorConfig;
+
+import javax.jms.ConnectionFactory;
+
+class AMQConnectionFactoryInitialiser implements ConnectionFactoryInitialiser
+{
+    public ConnectionFactory getFactory(ConnectorConfig config)
+    {
+        return new AMQConnectionFactory(config.getHost(), config.getPort(), "/test_path");
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,69 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.config;
+
+public abstract class AbstractConfig
+{
+    public boolean setOptions(String[] argv)
+    {
+        try
+        {
+            for(int i = 0; i < argv.length - 1; i += 2)
+            {
+                String key = argv[i];
+                String value = argv[i+1];
+                setOption(key, value);
+            }
+            return true;
+        }
+        catch(Exception e)
+        {
+            System.out.println(e.getMessage());
+            }
+        return false;
+    }
+    
+    protected int parseInt(String msg, String i)
+    {
+        try
+        {
+            return Integer.parseInt(i);
+        }
+        catch(NumberFormatException e)
+        {
+            throw new RuntimeException(msg + ": " + i);
+        }
+    }
+
+    protected long parseLong(String msg, String i)
+    {
+        try
+        {
+            return Long.parseLong(i);
+        }
+        catch(NumberFormatException e)
+        {
+            throw new RuntimeException(msg + ": " + i);
+        }
+    }
+
+    public abstract void setOption(String key, String value);
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,29 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.config;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+
+public interface ConnectionFactoryInitialiser
+{
+    public ConnectionFactory getFactory(ConnectorConfig config) throws JMSException;
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,40 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.config;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+
+public class Connector
+{
+    public Connection createConnection(ConnectorConfig config) throws Exception
+    {
+        return getConnectionFactory(config).createConnection();
+    }
+
+    ConnectionFactory getConnectionFactory(ConnectorConfig config) throws Exception
+    {
+        String factory = config.getFactory();
+        if(factory == null) factory = AMQConnectionFactoryInitialiser.class.getName();
+        System.out.println("Using " + factory);
+        return ((ConnectionFactoryInitialiser) Class.forName(factory).newInstance()).getFactory(config);
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.config;
+
+public interface ConnectorConfig
+{
+    public String getHost();
+    public int getPort();
+    public String getFactory();
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,111 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.config;
+
+import org.apache.qpid.config.ConnectionFactoryInitialiser;
+import org.apache.qpid.config.ConnectorConfig;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.MBeanException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.NameNotFoundException;
+import java.util.Hashtable;
+
+public class JBossConnectionFactoryInitialiser implements ConnectionFactoryInitialiser
+{
+    public ConnectionFactory getFactory(ConnectorConfig config) throws JMSException
+    {
+        ConnectionFactory cf = null;
+        InitialContext ic = null;
+        Hashtable ht = new Hashtable();
+        ht.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+        String jbossHost = System.getProperty("jboss.host", "eqd-lxamq01");
+        String jbossPort = System.getProperty("jboss.port", "1099");
+        ht.put(InitialContext.PROVIDER_URL, "jnp://" + jbossHost + ":" + jbossPort);
+        ht.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
+
+        try
+        {
+            ic = new InitialContext(ht);
+            if (!doesDestinationExist("topictest.messages", ic))
+            {
+                deployTopic("topictest.messages", ic);
+            }
+            if (!doesDestinationExist("topictest.control", ic))
+            {
+                deployTopic("topictest.control", ic);
+            }
+
+            cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
+            return cf;
+        }
+        catch (NamingException e)
+        {
+            throw new JMSException("Unable to lookup object: " + e);
+        }
+        catch (Exception e)
+        {
+            throw new JMSException("Error creating topic: " + e);
+        }
+    }
+
+    private boolean doesDestinationExist(String name, InitialContext ic) throws Exception
+    {
+        try
+        {
+            ic.lookup("/" + name);
+        }
+        catch (NameNotFoundException e)
+        {
+            return false;
+        }
+        return true;
+    }
+
+    private void deployTopic(String name, InitialContext ic) throws Exception
+    {
+        MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
+
+        ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
+
+        String jndiName = "/" + name;
+        try
+        {
+            mBeanServer.invoke(serverObjectName, "createTopic",
+                               new Object[]{name, jndiName},
+                               new String[]{"java.lang.String", "java.lang.String"});
+        }
+        catch (MBeanException e)
+        {
+            System.err.println("Error: " + e);
+            System.err.println("Cause: " + e.getCause());
+        }
+    }
+
+    private MBeanServerConnection lookupMBeanServerProxy(InitialContext ic) throws NamingException
+    {
+        return (MBeanServerConnection) ic.lookup("jmx/invoker/RMIAdaptor");
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,243 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.topic;
+
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.config.ConnectorConfig;
+import org.apache.qpid.config.ConnectionFactoryInitialiser;
+import org.apache.qpid.config.Connector;
+import org.apache.qpid.config.AbstractConfig;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+
+class Config extends AbstractConfig implements ConnectorConfig
+{
+
+    private String host = "localhost";
+    private int port = 5672;
+    private String factory = null;
+
+    private int payload = 256;
+    private int messages = 1000;
+    private int clients = 1;
+    private int batch = 1;
+    private long delay = 1;
+    private int warmup;
+    private int ackMode= AMQSession.NO_ACKNOWLEDGE;
+    private String clientId;
+    private String subscriptionId;
+    private boolean persistent;
+
+    public Config()
+    {
+    }
+
+    int getAckMode()
+    {
+        return ackMode;
+    }
+
+    void setPayload(int payload)
+    {
+        this.payload = payload;
+    }
+
+    int getPayload()
+    {
+        return payload;
+    }
+
+    void setClients(int clients)
+    {
+        this.clients = clients;
+    }
+
+    int getClients()
+    {
+        return clients;
+    }
+
+    void setMessages(int messages)
+    {
+        this.messages = messages;
+    }
+
+    int getMessages()
+    {
+        return messages;
+    }
+
+    public String getHost()
+    {
+        return host;
+    }
+
+    public void setHost(String host)
+    {
+        this.host = host;
+    }
+
+    public int getPort()
+    {
+        return port;
+    }
+
+    public String getFactory()
+    {
+        return factory;
+    }
+
+    public void setPort(int port)
+    {
+        this.port = port;
+    }
+
+    int getBatch()
+    {
+        return batch;
+    }
+
+    void setBatch(int batch)
+    {
+        this.batch = batch;
+    }
+
+    int getWarmup()
+    {
+        return warmup;
+    }
+
+    void setWarmup(int warmup)
+    {
+        this.warmup = warmup;
+    }
+
+    public long getDelay()
+    {
+        return delay;
+    }
+
+    public void setDelay(long delay)
+    {
+        this.delay = delay;
+    }
+
+    String getClientId()
+    {
+        return clientId;
+    }
+
+    String getSubscriptionId()
+    {
+        return subscriptionId;
+    }
+
+    boolean usePersistentMessages()
+    {
+        return persistent;
+    }
+
+    public void setOption(String key, String value)
+    {
+        if("-host".equalsIgnoreCase(key))
+        {
+            setHost(value);
+        }
+        else if("-port".equalsIgnoreCase(key))
+        {
+            try
+            {
+                setPort(Integer.parseInt(value));
+            }
+            catch(NumberFormatException e)
+            {
+                throw new RuntimeException("Bad port number: " + value);
+            }
+        }
+        else if("-payload".equalsIgnoreCase(key))
+        {
+            setPayload(parseInt("Bad payload size", value));
+        }
+        else if("-messages".equalsIgnoreCase(key))
+        {
+            setMessages(parseInt("Bad message count", value));
+        }
+        else if("-clients".equalsIgnoreCase(key))
+        {
+            setClients(parseInt("Bad client count", value));
+        }
+        else if("-batch".equalsIgnoreCase(key))
+        {
+            setBatch(parseInt("Bad batch count", value));
+        }
+        else if("-delay".equalsIgnoreCase(key))
+        {
+            setDelay(parseLong("Bad batch delay", value));
+        }
+        else if("-warmup".equalsIgnoreCase(key))
+        {
+            setWarmup(parseInt("Bad warmup count", value));
+        }
+        else if("-ack".equalsIgnoreCase(key))
+        {
+            ackMode = parseInt("Bad ack mode", value);
+        }
+        else if("-factory".equalsIgnoreCase(key))
+        {
+            factory = value;
+        }
+        else if("-clientId".equalsIgnoreCase(key))
+        {
+            clientId = value;
+        }
+        else if("-subscriptionId".equalsIgnoreCase(key))
+        {
+            subscriptionId = value;
+        }
+        else if("-persistent".equalsIgnoreCase(key))
+        {
+            persistent = "true".equalsIgnoreCase(value);
+        }
+        else
+        {
+            System.out.println("Ignoring unrecognised option: " + key);
+        }
+    }
+
+    static String getAckModeDescription(int ackMode)
+    {
+        switch(ackMode)
+        {
+            case AMQSession.NO_ACKNOWLEDGE: return "NO_ACKNOWLEDGE";
+            case AMQSession.AUTO_ACKNOWLEDGE: return "AUTO_ACKNOWLEDGE";
+            case AMQSession.CLIENT_ACKNOWLEDGE: return "CLIENT_ACKNOWLEDGE";
+            case AMQSession.DUPS_OK_ACKNOWLEDGE: return "DUPS_OK_ACKNOWELDGE";
+            case AMQSession.PRE_ACKNOWLEDGE: return "PRE_ACKNOWLEDGE";
+        }
+        return "AckMode=" + ackMode;
+    }
+
+    public Connection createConnection() throws Exception
+    {
+        return new Connector().createConnection(this);
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,141 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.topic;
+
+import javax.jms.Connection;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+public class Listener implements MessageListener
+{
+    private final Connection _connection;
+    private final MessageProducer _controller;
+    private final javax.jms.Session _session;
+    private final MessageFactory _factory;
+    private boolean init;
+    private int count;
+    private long start;
+
+    Listener(Connection connection, int ackMode) throws Exception
+    {
+        this(connection, ackMode, null);
+    }
+
+    Listener(Connection connection, int ackMode, String name) throws Exception
+    {
+        _connection = connection;
+        _session = connection.createSession(false, ackMode);
+        _factory = new MessageFactory(_session);
+
+        //register for events
+        if(name == null)
+        {
+            _factory.createTopicConsumer().setMessageListener(this);
+        }
+        else
+        {
+            _factory.createDurableTopicConsumer(name).setMessageListener(this);
+        }
+
+        _connection.start();
+
+        _controller = _factory.createControlPublisher();
+        System.out.println("Waiting for messages " +
+                Config.getAckModeDescription(ackMode)
+                + (name == null ? "" : " (subscribed with name " + name + " and client id " + connection.getClientID() + ")")
+                + "...");
+
+    }
+
+    private void shutdown()
+    {
+        try
+        {
+            _session.close();
+            _connection.stop();
+            _connection.close();
+        }
+        catch(Exception e)
+        {
+            e.printStackTrace(System.out);
+        }
+    }
+
+    private void report()
+    {
+        try
+        {
+            String msg = getReport();
+            _controller.send(_factory.createReportResponseMessage(msg));
+            System.out.println("Sent report: " + msg);
+        }
+        catch(Exception e)
+        {
+            e.printStackTrace(System.out);
+        }
+    }
+
+    private String getReport()
+    {
+        long time = (System.currentTimeMillis() - start);
+        return "Received " + count + " in " + time + "ms";
+    }
+
+    public void onMessage(Message message)
+    {
+        if(!init)
+        {
+            start = System.currentTimeMillis();
+            count = 0;
+            init = true;
+        }
+
+        if(_factory.isShutdown(message))
+        {
+            shutdown();
+        }
+        else if(_factory.isReport(message))
+        {
+            //send a report:
+            report();
+            init = false;
+        }
+        else if (++count % 100 == 0)
+        {
+            System.out.println("Received " + count + " messages.");
+        }
+    }
+
+    public static void main(String[] argv) throws Exception
+    {
+        Config config = new Config();
+        config.setOptions(argv);
+
+        Connection con = config.createConnection();
+        if(config.getClientId() != null)
+        {
+            con.setClientID(config.getClientId());
+        }
+        new Listener(con, config.getAckMode(), config.getSubscriptionId());
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,153 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.topic;
+
+import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.client.AMQTopic;
+
+import javax.jms.*;
+
+/**
+ */
+class MessageFactory
+{
+    private static final char[] DATA = "abcdefghijklmnopqrstuvwxyz".toCharArray();
+
+    private final Session _session;
+    private final Topic _topic;
+    private final Topic _control;
+    private final byte[] _payload;
+
+
+    MessageFactory(Session session) throws JMSException
+    {
+        this(session, 256);
+    }
+
+    MessageFactory(Session session, int size) throws JMSException
+    {
+        _session = session;
+        if(session instanceof AMQSession)
+        {
+            _topic = new AMQTopic("topictest.messages");
+            _control = new AMQTopic("topictest.control");
+        }
+        else
+        {
+            _topic = session.createTopic("topictest.messages");
+            _control = session.createTopic("topictest.control");
+        }
+        _payload = new byte[size];
+
+        for(int i = 0; i < size; i++)
+        {
+            _payload[i] = (byte) DATA[i % DATA.length];
+        }
+    }
+
+    Topic getTopic()
+    {
+        return _topic;
+    }
+
+    Message createEventMessage() throws JMSException
+    {
+        BytesMessage msg = _session.createBytesMessage();
+        msg.writeBytes(_payload);
+        return msg;
+    }
+
+    Message createShutdownMessage() throws JMSException
+    {
+        return _session.createTextMessage("SHUTDOWN");
+    }
+
+    Message createReportRequestMessage() throws JMSException
+    {
+        return _session.createTextMessage("REPORT");
+    }
+
+    Message createReportResponseMessage(String msg) throws JMSException
+    {
+        return _session.createTextMessage(msg);
+    }
+
+    boolean isShutdown(Message m)
+    {
+        return checkText(m, "SHUTDOWN");
+    }
+
+    boolean isReport(Message m)
+    {
+        return checkText(m, "REPORT");
+    }
+
+    Object getReport(Message m)
+    {
+        try
+        {
+            return ((TextMessage) m).getText();
+        }
+        catch (JMSException e)
+        {
+            e.printStackTrace(System.out);
+            return e.toString();
+        }
+    }
+
+    MessageConsumer createTopicConsumer() throws Exception
+    {
+        return _session.createConsumer(_topic);
+    }
+
+    MessageConsumer createDurableTopicConsumer(String name) throws Exception
+    {
+        return _session.createDurableSubscriber(_topic, name);
+    }
+
+    MessageConsumer createControlConsumer() throws Exception
+    {
+        return _session.createConsumer(_control);
+    }
+
+    MessageProducer createTopicPublisher() throws Exception
+    {
+        return _session.createProducer(_topic);
+    }
+
+    MessageProducer createControlPublisher() throws Exception
+    {
+        return _session.createProducer(_control);
+    }
+
+    private static boolean checkText(Message m, String s)
+    {
+        try
+        {
+            return m instanceof TextMessage && ((TextMessage) m).getText().equals(s);
+        }
+        catch (JMSException e)
+        {
+            e.printStackTrace(System.out);
+            return false;
+        }
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java?view=auto&rev=491072
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java (added)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java Fri Dec 29 10:37:34 2006
@@ -0,0 +1,175 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.topic;
+
+import javax.jms.*;
+
+public class Publisher implements MessageListener
+{
+    private final Object _lock = new Object();
+    private final Connection _connection;
+    private final Session _session;
+    private final MessageFactory _factory;
+    private final MessageProducer _publisher;
+    private int _count;
+
+    Publisher(Connection connection, int size, int ackMode, boolean persistent) throws Exception
+    {
+        _connection = connection;
+        _session = _connection.createSession(false, ackMode);
+        _factory = new MessageFactory(_session, size);
+        _publisher = _factory.createTopicPublisher();
+        _publisher.setDeliveryMode(persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
+        System.out.println("Publishing " + (persistent ? "persistent" : "non-persistent") + " messages of " + size + " bytes, " + Config.getAckModeDescription(ackMode) + ".");
+    }
+
+    private void test(Config config) throws Exception
+    {
+        test(config.getBatch(), config.getDelay(), config.getMessages(), config.getClients(), config.getWarmup());
+    }
+
+    private void test(int batches, long delay, int msgCount, int consumerCount, int warmup) throws Exception
+    {
+        _factory.createControlConsumer().setMessageListener(this);
+        _connection.start();
+
+        if(warmup > 0)
+        {
+            System.out.println("Runing warmup (" + warmup + " msgs)");
+            long time = batch(warmup, consumerCount);
+            System.out.println("Warmup completed in " + time + "ms");
+        }
+
+        long[] times = new long[batches];
+        for(int i = 0; i < batches; i++)
+        {
+            if(i > 0) Thread.sleep(delay*1000);
+            times[i] = batch(msgCount, consumerCount);
+            System.out.println("Batch " + (i+1) + " of " + batches + " completed in " + times[i] + " ms.");
+        }
+
+        long min = min(times);
+        long max = max(times);
+        System.out.println("min: " + min + ", max: " + max + " avg: " + avg(times, min, max));
+
+        //request shutdown
+        _publisher.send(_factory.createShutdownMessage());
+
+        _connection.stop();
+        _connection.close();
+    }
+
+    private long batch(int msgCount, int consumerCount) throws Exception
+    {
+        _count = consumerCount;
+        long start = System.currentTimeMillis();
+        publish(msgCount);
+        waitForCompletion(consumerCount);
+        return System.currentTimeMillis() - start;
+    }
+
+    private void publish(int count) throws Exception
+    {
+
+        //send events
+        for (int i = 0; i < count; i++)
+        {
+            _publisher.send(_factory.createEventMessage());
+            if ((i + 1) % 100 == 0)
+            {
+                System.out.println("Sent " + (i + 1) + " messages");
+            }
+        }
+
+        //request report
+        _publisher.send(_factory.createReportRequestMessage());
+    }
+
+    private void waitForCompletion(int consumers) throws Exception
+    {
+        System.out.println("Waiting for completion...");
+        synchronized (_lock)
+        {
+            while (_count > 0)
+            {
+                _lock.wait();
+            }
+        }
+    }
+
+
+    public void onMessage(Message message)
+    {
+        System.out.println("Received report " + _factory.getReport(message) + " " + --_count + " remaining");
+        if (_count == 0)
+        {
+            synchronized (_lock)
+            {
+                _lock.notify();
+            }
+        }
+    }
+
+    static long min(long[] times)
+    {
+        long min = times.length > 0 ? times[0] : 0;
+        for(int i = 0; i < times.length; i++)
+        {
+            min = Math.min(min, times[i]);
+        }
+        return min;
+    }
+
+    static long max(long[] times)
+    {
+        long max = times.length > 0 ? times[0] : 0;
+        for(int i = 0; i < times.length; i++)
+        {
+            max = Math.max(max, times[i]);
+        }
+        return max;
+    }
+
+    static long avg(long[] times, long min, long max)
+    {
+        long sum = 0;
+        for(int i = 0; i < times.length; i++)
+        {
+            sum += times[i];
+        }
+        sum -= min;
+        sum -= max;
+
+        return (sum / (times.length - 2));
+    }
+
+    public static void main(String[] argv) throws Exception
+    {
+        Config config = new Config();
+        config.setOptions(argv);
+
+        Connection con = config.createConnection();
+        int size = config.getPayload();
+        int ackMode = config.getAckMode();
+        boolean persistent = config.usePersistentMessages();
+        new Publisher(con, size, ackMode, persistent).test(config);
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java
------------------------------------------------------------------------------
    svn:eol-style = native