You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2007/02/14 21:02:22 UTC

svn commit: r507672 [15/16] - in /incubator/qpid/branches/qpid.0-9: gentools/src/org/apache/qpid/gentools/ gentools/templ.java/ gentools/templ.net/ java/ java/broker/ java/broker/bin/ java/broker/distribution/ java/broker/distribution/src/ java/broker/...

Modified: incubator/qpid/branches/qpid.0-9/java/distribution/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/distribution/pom.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/distribution/pom.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/distribution/pom.xml Wed Feb 14 12:02:03 2007
@@ -16,7 +16,10 @@
   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">
+<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-distribution</artifactId>
@@ -36,7 +39,7 @@
         <qpid.version>${pom.version}</qpid.version>
         <qpid.targetDir>${project.build.directory}</qpid.targetDir>
     </properties>
-    
+   
     <repositories>
       <repository>
         <id>repo1.maven.org</id>
@@ -48,18 +51,15 @@
     <dependencies>
         <dependency>
             <groupId>${pom.groupId}</groupId>
-            <artifactId>qpid-common</artifactId>
-            <version>${pom.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${pom.groupId}</groupId>
             <artifactId>qpid-broker</artifactId>
             <version>${pom.version}</version>
+            <type>jar</type>
         </dependency>
         <dependency>
             <groupId>${pom.groupId}</groupId>
             <artifactId>qpid-client</artifactId>
             <version>${pom.version}</version>
+            <type>jar</type>
         </dependency>
         <dependency>
             <groupId>${pom.groupId}.management</groupId>
@@ -85,7 +85,7 @@
                     <version>${assembly.version}</version>
                     <configuration>
                         <descriptors>
-                            <descriptor>src/main/assembly/bin.xml</descriptor>
+                               <descriptor>src/main/assembly/bin.xml</descriptor>
                         </descriptors>
                         <finalName>qpid-${pom.version}</finalName>
                         <outputDirectory>${qpid.targetDir}</outputDirectory>
@@ -106,14 +106,7 @@
                 </plugin>
             </plugins>
         </pluginManagement>
-        <resources>
-            <resource>
-                <directory>src/main/java</directory>
-                <includes>
-                    <include>**/*</include>
-                </includes>
-            </resource>
-        </resources>
+
         <plugins>
             <plugin>
                 <artifactId>maven-assembly-plugin</artifactId>
@@ -127,7 +120,6 @@
                         <configuration>
                             <descriptors>
                                 <descriptor>src/main/assembly/bin.xml</descriptor>
-                                <descriptor>src/main/assembly/client-bin.xml</descriptor>
                                 <descriptor>src/main/assembly/src.xml</descriptor>
                                 <descriptor>src/main/assembly/management-eclipse-plugin.xml</descriptor>
                                 <descriptor>src/main/assembly/management-eclipse-plugin-unix.xml</descriptor>
@@ -139,4 +131,74 @@
             </plugin>
         </plugins>
     </build>
-</project>
+
+    <profiles>
+        <profile>
+            <id>tests</id>
+
+            <dependencies>
+                <dependency>
+                    <groupId>${pom.groupId}</groupId>
+                    <artifactId>qpid-broker</artifactId>
+                    <version>${pom.version}</version>
+                    <type>jar</type>
+                </dependency>
+                <dependency>
+                    <groupId>${pom.groupId}</groupId>
+                    <artifactId>qpid-broker</artifactId>
+                    <version>${pom.version}</version>
+                    <type>test-jar</type>
+                </dependency>
+                <dependency>
+                    <groupId>${pom.groupId}</groupId>
+                    <artifactId>qpid-client</artifactId>
+                    <version>${pom.version}</version>
+                    <type>jar</type>
+                </dependency>
+                 <dependency>
+                    <groupId>${pom.groupId}</groupId>
+                    <artifactId>qpid-client</artifactId>
+                    <version>${pom.version}</version>
+                    <type>test-jar</type>
+                </dependency>
+                <dependency>
+                    <groupId>${pom.groupId}</groupId>
+                    <artifactId>qpid-perftests</artifactId>
+                    <version>${pom.version}</version>
+                    <type>test-jar</type>
+                </dependency>
+                <dependency>
+                    <groupId>${pom.groupId}</groupId>
+                    <artifactId>qpid-systests</artifactId>
+                    <version>${pom.version}</version>
+                    <type>test-jar</type>
+                </dependency>
+            </dependencies>
+
+            <build>
+                <plugins>
+                <plugin>
+                    <artifactId>maven-assembly-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>distribution-package</id>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>single</goal>
+                            </goals>
+                            <configuration>
+                                <descriptors>
+                                    <descriptor>src/main/assembly/bin-test.xml</descriptor>
+                                </descriptors>
+                                <finalName>qpid-${pom.version}</finalName>
+                            </configuration>
+                        </execution>
+                        </executions>
+                    </plugin>
+               </plugins>
+            </build>
+
+        </profile>
+    </profiles>
+
+</project>  

Modified: incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/bin.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/bin.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/bin.xml Wed Feb 14 12:02:03 2007
@@ -31,14 +31,17 @@
       <directory>src/main/release</directory>
       <outputDirectory>qpid-${qpid.version}</outputDirectory>
       <includes>
-    <include>DISCLAIMER</include>
+          <include>DISCLAIMER</include>
+          <include>LICENSE.txt</include>
+          <include>NOTICE.txt</include>
+          <include>README.txt</include>
       </includes>
     </fileSet>
     <fileSet>
       <directory>..</directory>
       <outputDirectory>qpid-${qpid.version}</outputDirectory>
       <includes>
-    <include>*.txt</include>
+          <include>*.txt</include>
       </includes>
     </fileSet>
     <fileSet>
@@ -53,14 +56,14 @@
       <directory>src/main/release/docs</directory>
       <outputDirectory>qpid-${qpid.version}/docs</outputDirectory>
       <includes>
-    <include>RELEASE_NOTES.txt</include>
+          <include>RELEASE_NOTES.txt</include>
       </includes>
     </fileSet>
     <fileSet>
       <directory>target</directory>
       <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
       <includes>
-    <include>qpid-incubating.jar</include>
+          <include>qpid-incubating.jar</include>
       </includes>
     </fileSet>
   </fileSets>
@@ -71,73 +74,67 @@
       <source>../common/etc/qpid-run.conf</source>
       <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
       <destName>qpid-run.conf</destName>
-      <fileMode>420</fileMode>
     </file>
     <file>
       <source>../broker/etc/config.xml</source>
       <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
       <destName>config.xml</destName>
-      <fileMode>420</fileMode>
     </file>
     <file>
       <source>../broker/etc/log4j.xml</source>
       <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
       <destName>log4j.xml</destName>
-      <fileMode>420</fileMode>
     </file>
     <file>
       <source>../broker/etc/passwd</source>
       <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
       <destName>passwd</destName>
-      <fileMode>420</fileMode>
     </file>
     <file>
       <source>../broker/etc/qpid-server.conf</source>
       <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
       <destName>qpid-server.conf</destName>
-      <fileMode>420</fileMode>
     </file>
     <file>
       <source>../broker/etc/virtualhosts.xml</source>
       <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
       <destName>virtualhosts.xml</destName>
-      <fileMode>420</fileMode>
     </file>
     <file>
       <source>../common/bin/qpid-run</source>
       <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
       <destName>qpid-run</destName>
-      <fileMode>493</fileMode>
+      <fileMode>0755</fileMode>
     </file>
     <file>
       <source>../broker/bin/qpid-server</source>
       <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
       <destName>qpid-server</destName>
-      <fileMode>493</fileMode>
+      <fileMode>0755</fileMode>
     </file>
     <file>
       <source>../broker/bin/qpid-server.bat</source>
       <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
       <destName>qpid-server.bat</destName>
-      <fileMode>493</fileMode>
+      <fileMode>0755</fileMode>
     </file>
     <file>
       <source>../broker/bin/run.bat</source>
       <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
       <destName>run.bat</destName>
-      <fileMode>493</fileMode>
+      <fileMode>0755</fileMode>
     </file>
     <file>
       <source>../broker/bin/run.sh</source>
       <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
       <destName>run.sh</destName>
-      <fileMode>493</fileMode>
+      <fileMode>0755</fileMode>
     </file>
     <file>
       <source>../broker/bin/runAll</source>
       <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
       <destName>runAll</destName>
-      <fileMode>493</fileMode>
+      <fileMode>0755</fileMode>
     </file>
   </files>
   <dependencySets>

Modified: incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml Wed Feb 14 12:02:03 2007
@@ -19,11 +19,10 @@
 -->
 <assembly>
   <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
-  <id>eclipse-plugin-unix</id>
+  <id>management-console-unix</id>
   <includeBaseDirectory>false</includeBaseDirectory>
   <formats>
     <format>tar.gz</format>
-    <format>zip</format>
   </formats>
 <!--
   <moduleSets>
@@ -75,10 +74,17 @@
       </includes>
     </fileSet>
     <fileSet>
+      <directory>../management/eclipse-plugin</directory>
+      <outputDirectory>qpidmc</outputDirectory>
+      <includes>
+        <include>README.txt</include>
+      </includes>
+    </fileSet>
+    <fileSet>
       <directory>../management/eclipse-plugin/bin</directory>
       <outputDirectory>qpidmc/bin</outputDirectory>
       <includes>
-        <include>qpidmc.sh</include>
+        <include>qpidmc*.sh</include>
       </includes>
       <fileMode>777</fileMode>
     </fileSet>

Modified: incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/management-eclipse-plugin.xml Wed Feb 14 12:02:03 2007
@@ -74,6 +74,13 @@
       </includes>      
     </fileSet>
     <fileSet>
+      <directory>../management/eclipse-plugin</directory>
+      <outputDirectory>qpidmc</outputDirectory>
+      <includes>
+        <include>README.txt</include>
+      </includes>
+    </fileSet>
+    <fileSet>
       <directory>../management/eclipse-plugin/bin</directory>
       <outputDirectory>qpidmc/bin</outputDirectory>
       <includes>

Modified: incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/src.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/src.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/src.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/distribution/src/main/assembly/src.xml Wed Feb 14 12:02:03 2007
@@ -32,10 +32,10 @@
       <outputDirectory>qpid-${qpid.version}-src</outputDirectory>
       <includes>
         <include>DISCLAIMER</include>
-        <include>LICENSE</include>
+        <include>LICENSE.txt</include>
         <include>licenses/*.*</include>
-        <include>NOTICE</include>
-        <include>README</include>
+        <include>NOTICE.txt</include>
+        <include>README.txt</include>
         <include>BUILDING.txt</include>
       </includes>
     </fileSet>

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/README.txt
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/README.txt?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/README.txt (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/README.txt Wed Feb 14 12:02:03 2007
@@ -4,4 +4,18 @@
 
 To run the management console, set the QPIDMC_HOME environment variable to
 qpid management console root directory (e.g. C:/qpidmc)and add $QPIDMC_HOME/bin to your PATH.
-Then run the qpidmc.bat batch file to launch the management console.
+Then run the script to launch the management console-
+For Windows:
+------------
+qpidmc.bat
+qpidmc.sh (using cygwin)
+
+Unix:
+-----
+qpidmc.sh <operating system> <windowing system> <platform achitecture>
+eg. qpidms.sh linux motif x86
+qpidmc_motif.sh
+qpidmc_gtk.sh
+
+Apache confluence page for latest information:
+http://cwiki.apache.org/confluence/display/qpid/Qpid+Management+Console

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/bin/qpidmc.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/bin/qpidmc.sh?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/bin/qpidmc.sh (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/bin/qpidmc.sh Wed Feb 14 12:02:03 2007
@@ -1,3 +1,54 @@
 #!/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.
+#
 
-"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar $QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -launcher $QPIDMC_HOME/eclipse/eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:$QPIDMC_HOME/configuration"
+if [ "$JAVA_HOME" == "" ]; then
+    echo "The JAVA_HOME environment variable is not defined";
+    exit 0;
+fi
+
+if [ "$QPIDMC_HOME" == "" ]; then
+    echo "The QPIDMC_HOME environment variable is not defined correctly";
+    exit 0;
+fi
+
+os=win32
+ws=win32
+arch=x86
+
+##echo $os
+##echo $ws
+##echo $arch
+
+## If this is to be run on different platform other than windows then following parameters should be passed
+## qpidmc.sh <operating system> <windowing system> <platform achitecture>
+## eg. qpidmc.sh linux motif x86
+if [ $# -eq 3 ]; then
+    os=$1
+    ws=$2
+    arch=$3
+fi
+
+if [ $os = "SunOS" ]; then
+    os="solaris"
+elif [ $os = "Linux" ]; then
+    os="linux"
+fi
+
+"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar $QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -launcher $QPIDMC_HOME/eclipse/eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:$QPIDMC_HOME/configuration" -os $os -ws $ws -arch $arch

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java Wed Feb 14 12:02:03 2007
@@ -32,12 +32,15 @@
     public final static String ITEM_TYPE  = "type";
     public final static String SERVER     = "server";
     public final static String DOMAIN     = "domain";
-    public final static String TYPE       = "mbeantype";
+    public final static String NODE_TYPE_MBEANTYPE = "mbeantype";
+    // currently used only for virtual host instances, but will work as general also
+    public final static String TYPE_INSTANCE = "mbeantype_instance";
     public final static String MBEAN      = "mbean";
     public final static String ATTRIBUTE = "Attribute";
     public final static String ATTRIBUTES = "Attributes";
     public final static String NOTIFICATION = "Notifications";
     public final static String RESULT = "Result";
+    public final static String VIRTUAL_HOST = "VirtualHost";
     
     public final static String ATTRIBUTE_QUEUE_DEPTH = "QueueDepth"; 
     

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java Wed Feb 14 12:02:03 2007
@@ -32,6 +32,7 @@
     private String _uniqueName = "";
     private String _domain = "";
     private String _type = "";
+    private String _virtualHostName = "Default";
     private ManagedServer _server = null;
     private HashMap _properties = null;
     
@@ -47,6 +48,7 @@
     public void setProperties(HashMap properties)
     {
         this._properties = properties;
+        setVirtualHostName(getProperty(Constants.VIRTUAL_HOST));
     }
     public String getDomain()
     {
@@ -80,6 +82,19 @@
     public void setUniqueName(String uniqueName)
     {
         this._uniqueName = uniqueName;
+    }
+    
+    public String getVirtualHostName()
+    {
+        return _virtualHostName;
+    }
+    
+    public void setVirtualHostName(String virtualHost)
+    {
+        if (virtualHost != null)
+        {
+            this._virtualHostName = virtualHost;
+        }
     }
     
 }

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java Wed Feb 14 12:02:03 2007
@@ -23,6 +23,8 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 import org.apache.qpid.management.ui.jmx.ClientListener;
 import org.apache.qpid.management.ui.model.ManagedAttributeModel;
@@ -33,11 +35,14 @@
 {
     private ManagedServer _managedServer = null;
     // list of all Connection mbeans
-    protected List<ManagedBean> _connections = new ArrayList<ManagedBean>();
+    //private List<ManagedBean> _connections = new ArrayList<ManagedBean>();
+    private ConcurrentMap<String,List<ManagedBean>> _connections = new ConcurrentHashMap<String,List<ManagedBean>>();
     // list of all exchange mbeans
-    protected List<ManagedBean> _exchanges = new ArrayList<ManagedBean>();
+    //private List<ManagedBean> _exchanges = new ArrayList<ManagedBean>();
+    private ConcurrentMap<String,List<ManagedBean>> _exchanges = new ConcurrentHashMap<String,List<ManagedBean>>();
     // list of all queue mbenas
-    protected List<ManagedBean> _queues = new ArrayList<ManagedBean>();
+    //private List<ManagedBean> _queues = new ArrayList<ManagedBean>();
+    private ConcurrentMap<String,List<ManagedBean>> _queues = new ConcurrentHashMap<String,List<ManagedBean>>();
     
     public ServerRegistry()
     {
@@ -61,47 +66,58 @@
     
     protected void addConnectionMBean(ManagedBean mbean)
     {
-        _connections.add(mbean);
+        String vHost = mbean.getVirtualHostName();
+        _connections.putIfAbsent(vHost, new ArrayList<ManagedBean>());
+        List<ManagedBean> beans = _connections.get(vHost);
+        beans.add(mbean);
     }
     
     protected void addExchangeMBean(ManagedBean mbean)
     {
-        _exchanges.add(mbean);
+        String vHost = mbean.getVirtualHostName();
+        _exchanges.putIfAbsent(vHost, new ArrayList<ManagedBean>());
+        List<ManagedBean> beans = _exchanges.get(vHost);
+        beans.add(mbean);
     }
     
     protected void addQueueMBean(ManagedBean mbean)
     {
-        _queues.add(mbean);
+        String vHost = mbean.getVirtualHostName();
+        _queues.putIfAbsent(vHost, new ArrayList<ManagedBean>());
+        List<ManagedBean> beans = _queues.get(vHost);
+        beans.add(mbean);
     }
     
     protected void removeConnectionMBean(ManagedBean mbean)
     {
-        _connections.remove(mbean);
+        String vHost = mbean.getVirtualHostName();
+        List<ManagedBean> beans = _connections.get(vHost);
+        beans.remove(mbean);
     }
     
     protected void removeExchangeMBean(ManagedBean mbean)
     {
-        _exchanges.remove(mbean);
+        _exchanges.get(mbean.getVirtualHostName()).remove(mbean);
     }
     
     protected void removeQueueMBean(ManagedBean mbean)
     {
-        _queues.remove(mbean);
+        _queues.get(mbean.getVirtualHostName()).remove(mbean);
     }
     
-    public List<ManagedBean> getConnections()
+    public List<ManagedBean> getConnections(String virtualHost)
     {
-        return _connections;
+        return _connections.get(virtualHost);
     }
     
-    public List<ManagedBean> getExchanges()
+    public List<ManagedBean> getExchanges(String virtualHost)
     {
-        return _exchanges;
+        return _exchanges.get(virtualHost);
     }
     
-    public List<ManagedBean> getQueues()
+    public List<ManagedBean> getQueues(String virtualHost)
     {
-        return _queues;
+        return _queues.get(virtualHost);
     }
     
     public abstract void addManagedObject(ManagedBean key);
@@ -123,11 +139,11 @@
     
     public abstract OperationDataModel getOperationModel(ManagedBean mbean);
     
-    public abstract String[] getQueueNames();
+    public abstract String[] getQueueNames(String vistualHostName);
     
-    public abstract String[] getExchangeNames();
+    public abstract String[] getExchangeNames(String vistualHostName);
     
-    public abstract String[] getConnectionNames();
+    public abstract String[] getConnectionNames(String vistualHostName);
     
     public abstract List<NotificationObject> getNotifications(ManagedBean mbean);
     

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java Wed Feb 14 12:02:03 2007
@@ -43,8 +43,6 @@
     
     public void handleNotification(Notification notification, Object handback)
     {
-        System.out.println("\nReceived server notification: " + notification);
-        
         ObjectName objName = null;
         String     type = notification.getType();
         if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(type))

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java Wed Feb 14 12:02:03 2007
@@ -34,7 +34,6 @@
     
     public void handleNotification(Notification notification, Object handback)
     {
-        System.out.println("\nReceived mbean notification: " + notification);
         ObjectName objName = (ObjectName)notification.getSource();
         //String     type = notification.getType();
         getServerRegistry().addNotification(objName, notification);

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java Wed Feb 14 12:02:03 2007
@@ -131,15 +131,15 @@
     
     public void addManagedObject(ManagedBean mbean)
     {
-        if (Constants.QUEUE.equals(mbean.getType()) && !mbean.getName().startsWith("tmp_"))
+        if (mbean.getType().endsWith(Constants.QUEUE) && !mbean.getName().startsWith("tmp_"))
         {
             addQueueMBean(mbean);
         }
-        else if (Constants.EXCHANGE.equals(mbean.getType()))
+        else if (mbean.getType().endsWith(Constants.EXCHANGE))
         {
             addExchangeMBean(mbean);
         }
-        else if (Constants.CONNECTION.equals(mbean.getType()))
+        else if (mbean.getType().endsWith(Constants.CONNECTION))
         {
             addConnectionMBean(mbean);
         }
@@ -149,11 +149,11 @@
 
     public void removeManagedObject(ManagedBean mbean)
     {
-        if (Constants.QUEUE.equals(mbean.getType()))
+        if (mbean.getType().endsWith(Constants.QUEUE))
             removeQueueMBean(mbean);
-        else if (Constants.EXCHANGE.equals(mbean.getType()))
+        else if (mbean.getType().endsWith(Constants.EXCHANGE))
             removeExchangeMBean(mbean);
-        else if (Constants.CONNECTION.equals(mbean.getType()))
+        else if (mbean.getType().endsWith(Constants.CONNECTION))
             removeConnectionMBean(mbean);
         
         _mbeansMap.remove(mbean.getUniqueName());
@@ -212,21 +212,31 @@
             _notificationsMap.get(mbean.getUniqueName()).clear();
     }
     
+    /**
+     * Adds notification name and type to the map. The map contains all the notification names,
+     * subscribed for an mbean.
+     * @param mbean
+     * @param name
+     * @param type
+     */
     public void addNotificationListener(ManagedBean mbean, String name, String type)
     {
-         HashMap<String, List<String>> map = _subscribedNotificationMap.get(mbean.getUniqueName());
+        // Get the subscribed notifications map for given mbean. If map is null then create a new one. 
+        HashMap<String, List<String>> map = _subscribedNotificationMap.get(mbean.getUniqueName());
         if (map == null)
         {
             map = new HashMap<String, List<String>>();
             _subscribedNotificationMap.put(mbean.getUniqueName(),map);
         }
         
+        // Get the list of notification types for given notification name. If null, then create a new list.
         List<String> list = map.get(name);
         if (list == null)
         {
             list = new ArrayList<String>();
             map.put(name, list);
         }
+        // Now add the notification type to the list
         if (Constants.ALL.equals(type))
         {
             List<NotificationInfoModel> infoList = _notificationInfoMap.get(mbean.getUniqueName());
@@ -247,9 +257,12 @@
             list.add(type);
         }
 
-        System.out.println("Subscribed for notification :" + mbean.getUniqueName());
+        //System.out.println("Subscribed for notification :" + mbean.getUniqueName());
     }
     
+    /**
+     * Checks if the given notification name and type are subscribed for the mbean.
+     */
     public boolean hasSubscribedForNotifications(ManagedBean mbean, String name, String type)
     {
         if (_subscribedNotificationMap.containsKey(mbean.getUniqueName()))
@@ -266,11 +279,20 @@
         return false;
     }
     
+    /**
+     * Clears the notification name and type information from the subscribed notifications map
+     * and removes the listener from mbeanserver connection
+     * @param mbean
+     * @param name
+     * @param type
+     * @throws Exception
+     */
     public void removeNotificationListener(ManagedBean mbean, String name, String type) throws Exception
     {
-        System.out.println("Removed notification listener :" + mbean.getUniqueName() + name +type);
+        //System.out.println("Removed notification listener :" + mbean.getUniqueName() + name +type);
         if (_subscribedNotificationMap.containsKey(mbean.getUniqueName()))
         {            
+            // get the notifications map. This map contains the notification name mapped with the notification types
             HashMap<String, List<String>> map = _subscribedNotificationMap.get(mbean.getUniqueName());
             if (map.containsKey(name))
             {
@@ -281,8 +303,16 @@
                 else if (type != null)
                 {
                     map.get(name).remove(type);
+                    if (map.get(name).isEmpty())
+                    {
+                        map.remove(name);
+                    }
                 }
             }
+            if (map.size() == 0)
+            {
+                _subscribedNotificationMap.remove(mbean.getUniqueName());
+            }
             
             JMXManagedObject jmxbean = (JMXManagedObject)mbean;
             _mbsc.removeNotificationListener(jmxbean.getObjectName(), _notificationListener);
@@ -335,33 +365,45 @@
         return _operationModelMap.get(mbean.getUniqueName());
     }
     
-    public String[] getQueueNames()
+    public String[] getQueueNames(String virtualHostName)
     {
-        String[] queues = new String[_queues.size()];
+        List<ManagedBean> list = getQueues(virtualHostName);
+        if (list == null)
+            return null;
+        
+        String[] queues = new String[list.size()];
         int i = 0;
-        for (ManagedBean mbean : _queues)
+        for (ManagedBean mbean : list)
         {
             queues[i++] = mbean.getName();
         }
         return queues;
     }
     
-    public String[] getExchangeNames()
+    public String[] getExchangeNames(String virtualHostName)
     {
-        String[] exchanges = new String[_exchanges.size()];
+        List<ManagedBean> list = getExchanges(virtualHostName);
+        if (list == null)
+            return null;
+        
+        String[] exchanges = new String[list.size()];
         int i = 0;
-        for (ManagedBean mbean : _exchanges)
+        for (ManagedBean mbean : list)
         {
             exchanges[i++] = mbean.getName();
         }
         return exchanges;
     }
     
-    public String[] getConnectionNames()
+    public String[] getConnectionNames(String virtualHostName)
     {
-        String[] connections = new String[_connections.size()];
+        List<ManagedBean> list = getExchanges(virtualHostName);
+        if (list == null)
+            return null;
+        
+        String[] connections = new String[list.size()];
         int i = 0;
-        for (ManagedBean mbean : _connections)
+        for (ManagedBean mbean : list)
         {
             connections[i++] = mbean.getName();
         }

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java Wed Feb 14 12:02:03 2007
@@ -25,7 +25,7 @@
     String name = "";
     String description = "";
     String dataType = "";
-    Object value = null;
+    Object value = "";
     boolean readable = true;
     boolean writable = false;
     
@@ -63,7 +63,8 @@
     }
     public void setValue(Object value)
     {
-        this.value = value;
+        if (value != null)
+            this.value = value;
     }
     public boolean isReadable()
     {

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java Wed Feb 14 12:02:03 2007
@@ -20,8 +20,6 @@
  */
 package org.apache.qpid.management.ui.views;
 
-import javax.management.openmbean.TabularDataSupport;
-
 import org.apache.qpid.management.ui.ApplicationRegistry;
 import org.apache.qpid.management.ui.Constants;
 import org.apache.qpid.management.ui.ManagedBean;
@@ -421,7 +419,7 @@
     {
         int width = 500;
         int height = 250;
-        if (data.getValue() instanceof TabularDataSupport)
+        if (!isSimpleType(data.getValue()))
         {
             width = 650;
             height = 450;
@@ -516,12 +514,12 @@
         }
         else
         {
-            if (attribute.getValue() instanceof TabularDataSupport)
+            if (!isSimpleType(attribute.getValue()))
             {
                 Composite composite = new Composite(parent, SWT.BORDER);
                 composite.setLayout(new GridLayout());
                 composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-                ViewUtility.createTabularDataHolder(_toolkit, composite,(TabularDataSupport)attribute.getValue());
+                ViewUtility.populateCompositeWithData(_toolkit, composite, attribute.getValue());
             }
             else
             {

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java Wed Feb 14 12:02:03 2007
@@ -233,19 +233,19 @@
         // populate the map and list with appropriate mbeans
         if (_type.equals(Constants.QUEUE))
         {
-            list = serverRegistry.getQueues();
+            list = serverRegistry.getQueues(MBeanView.getVirtualHost());
             items = getQueueItems(list);
             _sortBySizeButton.setVisible(true);
         }
         else if (_type.equals(Constants.EXCHANGE))
         {
-            list = serverRegistry.getExchanges();
+            list = serverRegistry.getExchanges(MBeanView.getVirtualHost());
             items = getItems(list);
             _sortBySizeButton.setVisible(false);
         }
         else if (_type.equals(Constants.CONNECTION))
         {
-            list = serverRegistry.getConnections();
+            list = serverRegistry.getConnections(MBeanView.getVirtualHost());
             items = getItems(list);
             _sortBySizeButton.setVisible(false);
         }
@@ -255,11 +255,15 @@
         }
         
         _list.setItems(items);
+            
     }
     
     // sets the map with appropriate mbean and name
     private String[] getItems(java.util.List<ManagedBean> list)
     {
+        if (list == null)
+            return new String[0];
+        
         Collections.sort(list, _sorterByName);
         String[] items = new String[list.size()];
         int i = 0;
@@ -273,6 +277,9 @@
     
     private String[] getQueueItems(java.util.List<ManagedBean> list) throws Exception
     {
+        if (list == null)
+            return new String[0];
+        
         // Sort the list. It will keep the mbeans in sorted order in the _queueMap, which is required for
         // sorting the queue according to size etc
         Collections.sort(list, _sorterByName);

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java Wed Feb 14 12:02:03 2007
@@ -64,6 +64,7 @@
     private static ManagedServer _server = null;
     private TreeObject _selectedNode = null;
     private ManagedBean _mbean = null;
+    private static String _virtualHostName = null;
     // This map contains a TabFolder for each kind of MBean. TabFolder is mapped with mbeantype(eg Connection, Queue etc)
     private HashMap<String, TabFolder> tabFolderMap = new HashMap<String, TabFolder>();
     private ISelectionListener selectionListener = new SelectionListenerImpl();
@@ -102,14 +103,10 @@
             setServer();
             try
             {
-                if (Constants.TYPE.equals(_selectedNode.getType()))
+                if (Constants.NODE_TYPE_MBEANTYPE.equals(_selectedNode.getType()))
                 {
                     refreshTypeTabFolder(_selectedNode.getName());
                 }
-                else if (Constants.DOMAIN.equals(_selectedNode.getType()))
-                {
-                    refreshTypeTabFolder(typeTabFolder.getItem(0));
-                }
                 else
                 {
                     showSelectedMBean();
@@ -134,22 +131,31 @@
         if (Constants.SERVER.equals(_selectedNode.getType()))
         {
             _server = (ManagedServer)_selectedNode.getManagedObject();
+            _virtualHostName = null;
         }
         else
         {
             TreeObject parent = _selectedNode.getParent();
-            while (!parent.getType().equals(Constants.SERVER))
+            while (parent != null && !parent.getType().equals(Constants.SERVER))
             {
                 parent = parent.getParent();
             }
             
-            _server = (ManagedServer)parent.getManagedObject();
+            if (parent != null && parent.getType().equals(Constants.SERVER))
+                _server = (ManagedServer)parent.getManagedObject();
+            
+            _virtualHostName = _selectedNode.getVirtualHost();
         }
     }
     
     public static ManagedServer getServer()
     {
         return _server;
+    }
+    
+    public static String getVirtualHost()
+    {
+        return _virtualHostName;
     }
     
     private void showSelectedMBean() throws Exception

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java Wed Feb 14 12:02:03 2007
@@ -33,6 +33,7 @@
 import org.apache.qpid.management.ui.ApplicationRegistry;
 import org.apache.qpid.management.ui.Constants;
 import org.apache.qpid.management.ui.ManagedBean;
+import org.apache.qpid.management.ui.ManagedObject;
 import org.apache.qpid.management.ui.ManagedServer;
 import org.apache.qpid.management.ui.ServerRegistry;
 import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
@@ -266,7 +267,7 @@
         catch(Exception ex)
         {
             System.out.println("\nError in connecting to Qpid broker ");
-            System.out.println("\n" + ex.toString());
+            ex.printStackTrace();
         }
     }
     
@@ -280,7 +281,7 @@
     private void populateDomain(TreeObject domain) throws IOException, Exception
     {
         ManagedServer server = (ManagedServer)domain.getParent().getManagedObject();
-        
+        /*
         // Add these three types - Connection, Exchange, Queue
         // By adding these, these will always be available, even if there are no mbeans under thse types
         // This is required because, the mbeans will be added from mbeanview, by selecting from the list
@@ -290,7 +291,7 @@
         typeChild.setParent(domain);
         typeChild = new TreeObject(Constants.QUEUE, Constants.TYPE);
         typeChild.setParent(domain);
-        
+        */
         
         // Now populate the mbenas under those types
         List<ManagedBean> mbeans = MBeanUtility.getManagedObjectsForDomain(server, domain.getName());
@@ -302,27 +303,43 @@
             
             // Add all mbeans other than Connections, Exchanges and Queues. Because these will be added
             // manually by selecting from MBeanView
-            if (!(mbean.getType().equals(Constants.CONNECTION) || mbean.getType().equals(Constants.EXCHANGE) || mbean.getType().equals(Constants.QUEUE)))
+            
+            if (!(mbean.getType().endsWith(Constants.CONNECTION) ||
+                  mbean.getType().endsWith(Constants.EXCHANGE) ||
+                  mbean.getType().endsWith(Constants.QUEUE)))
             {
                 addManagedBean(domain, mbean);
             }
         }
     }
     
+    private void addDefaultNodes(TreeObject parent)
+    {
+        TreeObject typeChild = new TreeObject(Constants.CONNECTION, Constants.NODE_TYPE_MBEANTYPE);
+        typeChild.setParent(parent);
+        typeChild.setVirtualHost(parent.getVirtualHost());
+        typeChild = new TreeObject(Constants.EXCHANGE, Constants.NODE_TYPE_MBEANTYPE);
+        typeChild.setParent(parent);
+        typeChild.setVirtualHost(parent.getVirtualHost());
+        typeChild = new TreeObject(Constants.QUEUE, Constants.NODE_TYPE_MBEANTYPE);
+        typeChild.setParent(parent);
+        typeChild.setVirtualHost(parent.getVirtualHost());
+    }
+    
     /**
      * Checks if a particular mbeantype is already there in the navigation view for a domain.
      * This is used while populating domain with mbeans.
-     * @param domain
+     * @param parent
      * @param typeName
      * @return Node if given mbeantype already exists, otherwise null
      */
-    private TreeObject getMBeanTypeNode(TreeObject domain, String typeName)
+    private TreeObject getMBeanTypeNode(TreeObject parent, String typeName)
     {
-        List<TreeObject> childNodes = domain.getChildren();
-        
+        List<TreeObject> childNodes = parent.getChildren();
         for (TreeObject child : childNodes)
         {
-            if (Constants.TYPE.equals(child.getType()) && typeName.equals(child.getName()))
+            if ((Constants.NODE_TYPE_MBEANTYPE.equals(child.getType()) || Constants.TYPE_INSTANCE.equals(child.getType())) &&
+                 typeName.equals(child.getName()))
                 return child;
         }
         return null;
@@ -346,46 +363,82 @@
      */
     private void addManagedBean(TreeObject domain, ManagedBean mbean) throws Exception
     {
-        String type = mbean.getType();
         String name = mbean.getName();
-
-        TreeObject typeNode = getMBeanTypeNode(domain, type);
-        if (typeNode != null && doesMBeanNodeAlreadyExist(typeNode, name))
-            return;
-        
-        TreeObject mbeanNode = null;
-        if (typeNode != null) // type node already exists
-        {
-            if (name == null)
+        String[] types = mbean.getType().split("\\.");
+        TreeObject typeNode = null;
+        TreeObject parentNode = domain;
+        // Run this loop till all nodes for this mbean are created.
+        for (int i = 0; i < types.length; i++)
+        {
+            String type = types[i];
+            String valueOftype = mbean.getProperty(type);
+            typeNode = getMBeanTypeNode(parentNode, type);
+            
+            if (typeNode == null)
             {
-                throw new ManagementConsoleException("Two mbeans can't exist without a name and with same type");
+                // If the ObjectName doesn't have name property, that means there will be only one instance
+                // of this mbean for given "type". So there will be no type node created for this mbean.
+                if (name == null && (i == types.length -1))
+                {
+                    break;
+                }
+                typeNode = createTypeNode(parentNode, type);
+                typeNode.setVirtualHost(mbean.getVirtualHostName());
             }
-            mbeanNode = new TreeObject(mbean);
-            mbeanNode.setParent(typeNode);
-        }
-        else
-        {
-            // type node does not exist. Now check if node to be created as mbeantype or MBean
-            if (name != null)  // A managedObject with type and name
+            parentNode = typeNode;
+            
+            // Create instances node for this type if value exists. For eg, for different virtual hosts, the
+            // nodes with given value will be created.
+            if (valueOftype == null)
             {
-                typeNode = new TreeObject(type, Constants.TYPE);
-                typeNode.setParent(domain);
-                mbeanNode = new TreeObject(mbean);
-                mbeanNode.setParent(typeNode);               
-            }
-            else              // A managedObject with only type
+                break;
+            }            
+            typeNode = getMBeanTypeNode(parentNode, valueOftype);
+            if (typeNode == null)
             {
-                mbeanNode = new TreeObject(mbean);
-                mbeanNode.setParent(domain);
+                typeNode = createTypeInstanceNode(parentNode, valueOftype);
+                typeNode.setVirtualHost(mbean.getVirtualHostName());
+                
+                // Create default nodes for VHost instances
+                if (type.equals(Constants.VIRTUAL_HOST))
+                {
+                    addDefaultNodes(typeNode);
+                }
             }
+            parentNode = typeNode;
+        }
+        
+        if (typeNode == null)
+        {
+            typeNode = parentNode;
         }
         
+        if (doesMBeanNodeAlreadyExist(typeNode, name))
+            return;
+        
+        TreeObject mbeanNode = new TreeObject(mbean);
+        mbeanNode.setParent(typeNode);
+        
         // Add notification node
         // TODO: show this only if the mbean sends any notification
         TreeObject notificationNode = new TreeObject(Constants.NOTIFICATION, Constants.NOTIFICATION);
         notificationNode.setParent(mbeanNode);
     }
     
+    private TreeObject createTypeNode(TreeObject parent, String name)
+    {
+        TreeObject typeNode = new TreeObject(name, Constants.NODE_TYPE_MBEANTYPE);
+        typeNode.setParent(parent);
+        return typeNode;
+    }
+    
+    private TreeObject createTypeInstanceNode(TreeObject parent, String name)
+    {
+        TreeObject typeNode = new TreeObject(name, Constants.TYPE_INSTANCE);
+        typeNode.setParent(parent);
+        return typeNode;
+    }
+    
     /**
      * Removes all the child nodes of the given parent node
      * @param parent
@@ -678,7 +731,14 @@
         public String getText(Object element)
         {
             TreeObject node = (TreeObject)element;
-            return node.getName();
+            if (node.getType().equals(Constants.NODE_TYPE_MBEANTYPE))
+            {
+                return node.getName() + "s";
+            }
+            else
+            {
+                return node.getName();
+            }
         }
         
         public Font getFont(Object element)
@@ -718,19 +778,21 @@
         {
             while(true)
             {
-                if (_managedServerMap.isEmpty())
-                    continue;
+                if (!_managedServerMap.isEmpty())
+                {
+                    refreshRemovedObjects();                               
+                    refreshClosedServerConnections();
+                }
                 
                 try
                 {
-                    Thread.sleep(2000);
+                    Thread.sleep(3000);
                 }
                 catch(Exception ex)
                 {
 
                 }                          
-                refreshRemovedObjects();                               
-                refreshClosedServerConnections();                                
+                                                
             }// end of while loop
         }// end of run method.        
     }// end of Worker class

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java Wed Feb 14 12:02:03 2007
@@ -326,7 +326,6 @@
                 Shell   shell = null;
                 public void doubleClick(DoubleClickEvent event)
                 {
-                    System.out.println("DoubleClickEvent" + event);
                     display = Display.getCurrent();
                     shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN |
                             SWT.MAX | SWT.RESIZE);

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java Wed Feb 14 12:02:03 2007
@@ -24,9 +24,6 @@
 import java.util.List;
 import java.util.Map.Entry;
 
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.TabularDataSupport;
-
 import org.apache.qpid.management.ui.ApplicationRegistry;
 import org.apache.qpid.management.ui.Constants;
 import org.apache.qpid.management.ui.ManagedBean;
@@ -92,6 +89,7 @@
     
     // for customized method in header exchange
     private HashMap<Text, Text> headerBindingHashMap = null;
+    private String _virtualHostName = null;
     
     public OperationTabControl(TabFolder tabFolder)
     {
@@ -155,6 +153,7 @@
     {
         _mbean = mbean;
         _opData = opData;
+        _virtualHostName = _mbean.getProperty(Constants.VIRTUAL_HOST);
         
         // Setting the form to be invisible. Just in case the mbean server connection
         // is done and it takes time in getting the response, then the ui should be blank
@@ -219,8 +218,8 @@
         }
         
         // Customised parameter widgets        
-        if (_mbean.getType().equals(Constants.EXCHANGE) &&
-            "headers".equals(_mbean.getProperty(Constants.EXCHANGE_TYPE)) &&
+        if (_mbean.getType().endsWith(Constants.EXCHANGE) &&
+            Constants.EXCHANGE_TYPE_VALUES[2].equals(_mbean.getProperty(Constants.EXCHANGE_TYPE)) &&
             _opData.getName().equalsIgnoreCase("createNewBinding"))
         {                                  
             customCreateNewBinding(); 
@@ -247,7 +246,7 @@
             if (param.getName().equals(Constants.QUEUE))
             {
                 Combo combo = new Combo(_paramsComposite, SWT.READ_ONLY | SWT.DROP_DOWN);
-                String[] items = ApplicationRegistry.getServerRegistry(_mbean).getQueueNames();
+                String[] items = ApplicationRegistry.getServerRegistry(_mbean).getQueueNames(_virtualHostName);
                 combo.setItems(items);
                 combo.add("Select Queue", 0); 
                 combo.select(0);
@@ -259,7 +258,7 @@
             else if (param.getName().equals(Constants.EXCHANGE))
             {
                 Combo combo = new Combo(_paramsComposite, SWT.READ_ONLY | SWT.DROP_DOWN);
-                String[] items = ApplicationRegistry.getServerRegistry(_mbean).getExchangeNames();
+                String[] items = ApplicationRegistry.getServerRegistry(_mbean).getExchangeNames(_virtualHostName);
                 combo.setItems(items);
                 combo.add("Select Exchange", 0);
                 combo.select(0);
@@ -360,8 +359,8 @@
         formData.left = new FormAttachment(label, 5);
         formData.right = new FormAttachment(valueNumerator);
 
-        Combo combo = new Combo(composite, SWT.READ_ONLY | SWT.DROP_DOWN);
-        String[] items = ApplicationRegistry.getServerRegistry(_mbean).getQueueNames();
+        Combo combo = new Combo(composite, SWT.READ_ONLY | SWT.DROP_DOWN);        
+        String[] items = ApplicationRegistry.getServerRegistry(_mbean).getQueueNames(_virtualHostName);
         combo.setItems(items);
         combo.add("Select Queue", 0); 
         combo.select(0);
@@ -472,7 +471,7 @@
         int width = 600;
         int height = 400;
         Shell shell = ViewUtility.createPopupShell(Constants.RESULT, width, height);
-        populateResults(result, shell);
+        ViewUtility.populateCompositeWithData(_toolkit, shell, result);
         
         shell.open();
         while (!shell.isDisposed()) {
@@ -484,23 +483,6 @@
     }
     
     /**
-     * Displays the operation result
-     * @param result
-     * @param parent
-     */
-    private void populateResults(Object result, Composite parent)
-    {
-        if (result instanceof TabularDataSupport)
-        {
-            ViewUtility.createTabularDataHolder(_toolkit, parent, (TabularDataSupport)result);
-        }
-        else if (result instanceof CompositeDataSupport)
-        {
-            ViewUtility.populateCompositeDataHolder(_toolkit, parent, (CompositeDataSupport)result);
-        }
-    }  
-    
-    /**
      * Clears the parameter values of the operation
      */
     private void clearParameters()
@@ -521,7 +503,7 @@
      */
     private void clearParameterValues(Composite control)
     {
-        if (control == null)
+        if (control == null || (control.isDisposed()))
             return;
         
         Control[] controls = control.getChildren();
@@ -623,7 +605,7 @@
         else
         {
             ViewUtility.disposeChildren(_resultsComposite);
-            populateResults(result, _resultsComposite);
+            ViewUtility.populateCompositeWithData(_toolkit, _resultsComposite, result);
             _resultsComposite.layout();
             _form.layout();
         }

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java Wed Feb 14 12:02:03 2007
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.management.ui.views;
 
+import java.util.ArrayList;
+
 import org.apache.qpid.management.ui.ManagedBean;
 import org.apache.qpid.management.ui.model.OperationData;
 import org.eclipse.swt.widgets.Control;
@@ -34,6 +36,26 @@
     protected ManagedBean _mbean = null;
     protected TabFolder _tabFolder = null;
     
+    private static java.util.List<String> simpleTypes = new ArrayList<String>();
+    
+    static
+    {
+        simpleTypes.add("java.math.BigDecimal");
+        simpleTypes.add("java.math.BigInteger");
+        simpleTypes.add("java.lang.Boolean");
+        simpleTypes.add("java.lang.Byte");
+        simpleTypes.add("java.lang.Character");
+        simpleTypes.add("java.util.Date");
+        simpleTypes.add("java.lang.Double");
+        simpleTypes.add("java.lang.Float");
+        simpleTypes.add("java.lang.Integer");
+        simpleTypes.add("java.lang.Long");
+        simpleTypes.add("javax.management.ObjectName");
+        simpleTypes.add("java.lang.Short");
+        simpleTypes.add("java.lang.String");
+        simpleTypes.add("boolean");
+    }
+    
     public TabControl(TabFolder tabFolder)
     {
         _tabFolder = tabFolder;
@@ -60,5 +82,10 @@
     public void setFocus()
     {
         
+    }
+    
+    public boolean isSimpleType(Object data)
+    {        
+        return simpleTypes.contains(data.getClass().getName());
     }
 }

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java Wed Feb 14 12:02:03 2007
@@ -32,6 +32,7 @@
     private String _name;
     private String _type;
     private String _url;
+    private String _virtualHost;
     private TreeObject _parent;
     private List<TreeObject> _children = new ArrayList<TreeObject>();
     private ManagedObject _object;
@@ -47,7 +48,8 @@
         _name = obj.getName();
         if (_name == null && (obj instanceof ManagedBean))
         {
-            _name = ((ManagedBean)obj).getType();
+            String[] types = ((ManagedBean)obj).getType().split("\\.");
+            _name = types[types.length - 1];
         }
         this._type = Constants.MBEAN;
         this._object = obj;
@@ -95,6 +97,16 @@
     public void setUrl(String url)
     {
         this._url = url;
+    }
+    
+    public String getVirtualHost()
+    {
+        return _virtualHost;
+    }
+    
+    public void setVirtualHost(String vHost)
+    {
+        _virtualHost = vHost;
     }
 
     public ManagedObject getManagedObject()

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java Wed Feb 14 12:02:03 2007
@@ -28,6 +28,7 @@
 
 import javax.management.openmbean.ArrayType;
 import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.CompositeType;
 import javax.management.openmbean.OpenType;
 import javax.management.openmbean.TabularDataSupport;
@@ -53,6 +54,10 @@
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
+/**
+ * Utility Class for displaying OpenMbean data types by creating required SWT widgets
+ * @author Bhupendra Bhardwaj
+ */
 public class ViewUtility
 {
     public static final String OP_NAME     = "operation_name";
@@ -77,8 +82,26 @@
         SUPPORTED_ARRAY_DATATYPES.add("java.util.Date");
     }
     
+    /**
+     * Populates the composite with given openmbean data type (TabularType or CompositeType)
+     * @param toolkit
+     * @param parent composite
+     * @param data open mbean data type(either composite type or tabular data type)
+     */
+    public static void populateCompositeWithData(FormToolkit toolkit, Composite parent, Object data)
+    {
+        if (data instanceof TabularDataSupport)
+        {
+            ViewUtility.createTabularDataHolder(toolkit, parent, (TabularDataSupport)data);
+        }
+        else if (data instanceof CompositeDataSupport)
+        {
+            ViewUtility.populateCompositeWithCompositeData(toolkit, parent, (CompositeDataSupport)data);
+        }
+    }
+    
     @SuppressWarnings("unchecked")
-    public static void createTabularDataHolder(FormToolkit toolkit, Composite parent, TabularDataSupport tabularData)
+    private static void createTabularDataHolder(FormToolkit toolkit, Composite parent, TabularDataSupport tabularData)
     {
         Composite composite = toolkit.createComposite(parent, SWT.BORDER);
         GridLayout layout = new GridLayout(4, true);
@@ -109,7 +132,7 @@
         // display the first record
         CompositeData data = (CompositeData)(list.get(0)).getValue();
         composite.setData(INDEX, 0);
-        populateCompositeDataHolder(toolkit, compositeDataHolder, data);
+        populateCompositeWithCompositeData(toolkit, compositeDataHolder, data);
         enableOrDisableTraversalButtons(composite);
     }
 
@@ -135,7 +158,15 @@
         }
     }
 
-    public static Composite createCompositeDataHolder(final FormToolkit toolkit, final Composite dataHolder, CompositeType compositeType)
+    /**
+     * Sets up the given composite for holding a CompositeData. Create traversal buttons, label etc and
+     * creates a child Composite, which should be populated with the CompositeData
+     * @param toolkit
+     * @param dataHolder
+     * @param compositeType
+     * @return
+     */
+    private static Composite createCompositeDataHolder(final FormToolkit toolkit, final Composite dataHolder, CompositeType compositeType)
     {        
         String desc = compositeType.getDescription();
         Label description = toolkit.createLabel(dataHolder, desc, SWT.CENTER);
@@ -164,6 +195,7 @@
         layoutData.widthHint = 80;
         lastRecordButton.setLayoutData(layoutData);
         
+        // Now create the composite, which will hold the CompositeData
         final Composite composite = toolkit.createComposite(dataHolder, SWT.NONE);
         GridLayout layout = new GridLayout();
         layout.horizontalSpacing = layout.verticalSpacing = 0;
@@ -179,7 +211,8 @@
         dataHolder.setData(PREV, previousRecordButton);
         dataHolder.setData(LAST, lastRecordButton);
 
-        // Listener for the traversal buttons
+        // Listener for the traversal buttons. When a button is clicked the respective
+        // CompositeData will be populated in the composite
         SelectionListener listener = new SelectionAdapter()
         {
             public void widgetSelected(SelectionEvent e)
@@ -188,8 +221,9 @@
                     return;
 
                 Button traverseButton =(Button)e.widget; 
+                // Get the CompositeData respective to the button selected
                 CompositeData data = getCompositeData(dataHolder, traverseButton.getText());
-                populateCompositeDataHolder(toolkit, composite, data);
+                populateCompositeWithCompositeData(toolkit, composite, data);
                 enableOrDisableTraversalButtons(dataHolder);   
             }
         };
@@ -202,6 +236,13 @@
         return composite;
     }
     
+    /**
+     * The CompositeData is set as data with the Composite and using the index, this method will
+     * return the corresponding CompositeData
+     * @param compositeHolder
+     * @param dataIndex
+     * @return the CompositeData respective to the index
+     */
     private static CompositeData getCompositeData(Composite compositeHolder, String dataIndex)
     {
         List objectData = (List)compositeHolder.getData();
@@ -236,13 +277,18 @@
 
         // Set the index being shown.
         compositeHolder.setData(INDEX, index);
-        System.out.println("index :" + index);
 
         return (CompositeData)((Map.Entry)objectData.get(index)).getValue();
     }
 
+    /**
+     * Populates the given composite with the CompositeData. Creates required widgets to hold the data types
+     * @param toolkit
+     * @param parent
+     * @param data CompositeData
+     */
     @SuppressWarnings("unchecked")
-    public static void populateCompositeDataHolder(FormToolkit toolkit, Composite parent, CompositeData data/*String dataIndex*/)
+    private static void populateCompositeWithCompositeData(FormToolkit toolkit, Composite parent, CompositeData data)
     {
         Control[] oldControls = parent.getChildren();       
         for (int i = 0; i < oldControls.length; i++)
@@ -273,7 +319,6 @@
                 if (itemType.isArray())
                 {
                     OpenType type = ((ArrayType)itemType).getElementOpenType();
-                    System.out.println("Array Element type = " + type.getClassName());
                     //  If Byte array and mimetype is text, convert to text string
                     if (type.getClassName().equals(Byte.class.getName()))
                     {
@@ -343,7 +388,6 @@
         try
         {
             String textMessage = new String(byteArray, encoding);
-            System.out.println("\nMessage : \n" + textMessage + "\n");
 
             Text valueText = toolkit.createText(compositeHolder, textMessage, SWT.READ_ONLY | SWT.BORDER |
                     SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);

Modified: incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini (original)
+++ incubator/qpid/branches/qpid.0-9/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini Wed Feb 14 12:02:03 2007
@@ -24,3 +24,4 @@
 eclipse.application=org.apache.qpid.management.ui.application
 osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.motif.linux.x86,org.eclipse.swt.gtk.linux.x86_64,org.eclipse.swt.gtk.linux.x86,org.eclipse.swt.gtk.linux.ppc,org.eclipse.swt.motif.hpux.PA_RISC,org.eclipse.swt.gtk.solaris.sparc,org.eclipse.swt.motif.solaris.sparc,org.eclipse.swt.carbon.macocx,org.eclipse.ui,org.eclipse.ui.forms,org.eclipse.ui.workbench
 osgi.bundles.defaultStartLevel=4
+eof=eof
\ No newline at end of file

Propchange: incubator/qpid/branches/qpid.0-9/java/perftests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Feb 14 12:02:03 2007
@@ -0,0 +1,2 @@
+target
+qpid-perftests.iml

Propchange: incubator/qpid/branches/qpid.0-9/java/perftests/distribution/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Feb 14 12:02:03 2007
@@ -0,0 +1 @@
+target

Modified: incubator/qpid/branches/qpid.0-9/java/perftests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/perftests/pom.xml?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/perftests/pom.xml (original)
+++ incubator/qpid/branches/qpid.0-9/java/perftests/pom.xml Wed Feb 14 12:02:03 2007
@@ -19,6 +19,7 @@
 <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>
@@ -35,21 +36,219 @@
 
     <properties>
         <topDirectoryLocation>..</topDirectoryLocation>
+        <log4j.perftests>perftests.log4j</log4j.perftests>
     </properties>
 
+    <!-- Temporary local maven repo, whilst JUnit Toolkit is still reaching stable version to add to central maven repository. -->
+    <repositories>
+        <repository>
+          <id>junit-toolkit.snapshots</id>
+          <name>JUnit Toolkit SNAPSHOT Repository</name>
+	  <url>file://${basedir}/../mvn-repo</url>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+    </repositories>
+
+    <!-- Temporary local maven repo, whilst JUnit Toolkit is still reaching stable version to add to central maven repository. -->
+    <pluginRepositories>
+        <pluginRepository>
+          <id>junit-toolkit-plugin.snapshots</id>
+          <name>JUnit Toolkit SNAPSHOT Repository</name>
+	  <url>file://${basedir}/../mvn-repo</url>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
     <dependencies>
+
         <dependency>
             <groupId>org.apache.qpid</groupId>
             <artifactId>qpid-client</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>uk.co.thebadgerset</groupId>
+            <artifactId>junit-toolkit</artifactId>
+        </dependency>
+
+        <!-- Test dependencies. -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+
     </dependencies>
 
-<!--    <build>
+    <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-antrun-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+            </plugin>
+
+            <!-- The JUnit Toolkit maven2 plugin is in the process of being added to the maven repository.
+
+                 Configures the toolkit test runner for performance testing. These can be run from within maven, or by using the generated
+                 scripts.
+
+                 To run from within maven:
+
+                 mvn uk.co.thebadgerset:junit-toolkit-maven-plugin:tktest
+
+                 To run from the command line (after doing assembly:assembly goal):
+
+                 java -cp target/test_jar-jar-with-dependencies.jar uk.co.thebadgerset.junit.extensions.TKTestRunner -s 1 -r 100000 
+                      -o target org.apache.qpid.requestreply.PingPongTestPerf
+
+                 To generate the scripts do:
+
+                 mvn uk.co.thebadgerset:junit-toolkit-maven-plugin:tkscriptgen
+
+                 Then to run the scripts, in the target directory do (after doing assembly:assembly goal):
+
+                 ./script_name.sh
+
+                 These scripts can find everything in the 'all test dependencies' jar created by the assembly:assembly goal.
+                 -->
+            <plugin>
+              <groupId>uk.co.thebadgerset</groupId>
+              <artifactId>junit-toolkit-maven-plugin</artifactId>
+
+              <configuration>
+                <scriptOutDirectory>target</scriptOutDirectory>
+                <testJar>${project.build.finalName}-all-test-deps.jar</testJar>
+
+                <systemproperties>
+                  <property>
+                    <name>log4j.configuration</name>
+                    <value>${log4j.perftests}</value>
+                  </property>
+                  <property>
+                    <name>amqj.logging.level</name>
+                    <value>warn</value>
+                  </property>
+                  <property><!-- Turn off most logging messages from the junit-toolkit test tool itself. -->
+                    <name>badger.level</name>
+                    <value>warn</value>
+                  </property>
+                  <property>
+                    <name>amqj.test.logging.level</name>
+                    <value>info</value>
+                  </property>
+                </systemproperties>
+
+                <commands>
+                  <!-- Single pings. These can be scaled up by overriding the parameters when calling the test script. -->
+                  <Ping-Once>-n Ping-Once -s [1] -r 1 -t testPingOk -o . org.apache.qpid.ping.PingTestPerf</Ping-Once>
+                  <Ping-Once-Async>-n Ping-Once-Async -s [1] -r 1 -t testAsyncPingOk -o . org.apache.qpid.ping.PingAsyncTestPerf</Ping-Once-Async>
+                  <Ping-Latency>-n Ping-Latency -s [1000] -d 10S -t testPingLatency -o . org.apache.qpid.ping.PingLatencyTestPerf</Ping-Latency>
+
+                  <!-- More example Tests. These are examples to exercise all the features of the test harness. Can scale up with option overrides. -->
+                  <Ping-Tx>-n Ping-Tx -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf transacted=true</Ping-Tx>
+                  <Ping-Size>-n Ping-Size -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messagesize=512</Ping-Size>
+                  <Ping-Concurrent>-n Ping-Concurrent -s [100] -c [4] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf</Ping-Concurrent>
+                  <Ping-Many-Queues>
+		      -n Ping-Many-Queues -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf destinationcount=4
+		  </Ping-Many-Queues>
+                  <Ping-Duration>-n Ping-Duration -s [100] -d10S -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf</Ping-Duration>
+                  <Ping-Rate>-n Ping-Rate -s [100] -d10S -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf rate=500</Ping-Rate>
+		  <Ping-PubSub>-n Ping-PubSub -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true</Ping-PubSub>
+		  <Ping-Many-Topics>
+		      -n Ping-Many-Topics -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true destinationcount=4
+		  </Ping-Many-Topics>
+                  <Ping-Persistent>
+		      -n Ping-Persistent -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true
+		  </Ping-Persistent>
+                  <Ping-Batch-Logging>
+		      -n Ping-Batch-Logging -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf BatchSize=10
+		  </Ping-Batch-Logging>
+		  <Ping-Failover-Before-Send> 
+		      -n Ping-Failover-Before-Send -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf CommitBatchSize=10 FailBeforeSend=true
+		  </Ping-Failover-Before-Send>
+		  <Ping-Failover-After-Send>
+		      -n Ping-Failover-After-Send -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf CommitBatchSize=10 FailAfterSend=true
+		  </Ping-Failover-After-Send>
+		  <Ping-Failover-Before-Commit>
+		      -n Ping-Failover-Before-Commit -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf CommitBatchSize=10 FailBeforeCommit=true
+		  </Ping-Failover-Before-Commit>
+		  <Ping-Failover-After-Commit>
+		      -n Ping-Failover-After-Commit -s [100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf CommitBatchSize=10 FailAfterCommit=true
+		  </Ping-Failover-After-Commit>
+
+                </commands>
+              </configuration>
+
+              <executions>
+                <execution>
+                  <phase>test</phase>
+                  <!--<goals>
+                    <goal>tktest</goal>
+                  </goals>-->
+                </execution>
+              </executions>
+            </plugin>
+
+            <!-- Bundles all the dependencies, fully expanded into a single jar, required to run the tests.
+
+                 Usefull when bundling system, integration or performance tests into a convenient
+                 package to hand over to testers. To use it run:
+
+                 java -cp target/your_app_name-all-test-deps.jar path.to.your.Class
+
+                 or often:
+
+                 java -cp target/your_app_name-all-test-deps.jar junit.framework.textui.TestRunner path.to.your.test.Class
+
+                 or other JUnit test runner invocations.
+                 -->
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-assembly-plugin</artifactId>
+              <version>2.2-SNAPSHOT</version>
+              <configuration>
+                <descriptors>
+                  <descriptor>jar-with-dependencies.xml</descriptor>
+                </descriptors>
+                <outputDirectory>target</outputDirectory>
+                <workDirectory>target/assembly/work</workDirectory>
+              </configuration>
+            </plugin>
+
         </plugins>
-    </build>-->
+
+        <resources>
+            <!-- Include source files in built jar -->
+            <resource>
+                <targetPath>src/</targetPath>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.java</include>
+                </includes>
+            </resource>
+            <!-- Include a log4j configuration in the jar at the root level (don't name this log4j.properties though as won't be able to override it). -->
+            <resource>
+                <targetPath>/</targetPath>
+                <filtering>false</filtering>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>perftests.log4j</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+
 </project>

Modified: incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Config.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Config.java?view=diff&rev=507672&r1=507671&r2=507672
==============================================================================
--- incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Config.java (original)
+++ incubator/qpid/branches/qpid.0-9/java/perftests/src/main/java/org/apache/qpid/topic/Config.java Wed Feb 14 12:02:03 2007
@@ -22,14 +22,12 @@
 
 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
+public class Config extends AbstractConfig implements ConnectorConfig
 {
 
     private String host = "localhost";
@@ -45,23 +43,30 @@
     private int ackMode= AMQSession.NO_ACKNOWLEDGE;
     private String clientId;
     private String subscriptionId;
+    private String selector;
+    private String destinationName;
     private boolean persistent;
+    private boolean transacted;
+    private int destinationsCount;
+    private int batchSize;
+    private int rate;
+    private boolean ispubsub;
 
     public Config()
     {
     }
 
-    int getAckMode()
+    public int getAckMode()
     {
         return ackMode;
     }
 
-    void setPayload(int payload)
+    public void setPayload(int payload)
     {
         this.payload = payload;
     }
 
-    int getPayload()
+    public int getPayload()
     {
         return payload;
     }
@@ -81,11 +86,26 @@
         this.messages = messages;
     }
 
-    int getMessages()
+    public int getMessages()
     {
         return messages;
     }
 
+    public int getBatchSize()
+    {
+        return batchSize;
+    }
+
+    public int getRate()
+    {
+        return rate;
+    }
+
+    public int getDestinationsCount()
+    {
+        return destinationsCount;
+    }
+
     public String getHost()
     {
         return host;
@@ -141,21 +161,41 @@
         this.delay = delay;
     }
 
-    String getClientId()
+    public String getClientId()
     {
         return clientId;
     }
 
-    String getSubscriptionId()
+    public String getSubscriptionId()
     {
         return subscriptionId;
     }
 
-    boolean usePersistentMessages()
+    public String getSelector()
+    {
+        return selector;
+    }
+
+    public String getDestination()
+    {
+        return destinationName;
+    }
+
+    public boolean usePersistentMessages()
     {
         return persistent;
     }
 
+    public boolean isTransacted()
+    {
+        return transacted;
+    }
+
+    public boolean isPubSub()
+    {
+        return ispubsub;
+    }
+
     public void setOption(String key, String value)
     {
         if("-host".equalsIgnoreCase(key))
@@ -216,6 +256,34 @@
         else if("-persistent".equalsIgnoreCase(key))
         {
             persistent = "true".equalsIgnoreCase(value);
+        }
+        else if("-transacted".equalsIgnoreCase(key))
+        {
+            transacted = "true".equalsIgnoreCase(value);
+        }
+        else if ("-destinationscount".equalsIgnoreCase(key))
+        {
+            destinationsCount = parseInt("Bad destinations count", value);
+        }
+        else if ("-batchsize".equalsIgnoreCase(key))
+        {
+            batchSize = parseInt("Bad batch size", value);
+        }
+        else if ("-rate".equalsIgnoreCase(key))
+        {
+            rate = parseInt("MEssage rate", value);
+        }
+        else if("-pubsub".equalsIgnoreCase(key))
+        {
+            ispubsub = "true".equalsIgnoreCase(value);
+        }
+        else if("-selector".equalsIgnoreCase(key))
+        {
+            selector = value;
+        }
+        else if("-destinationname".equalsIgnoreCase(key))
+        {
+            destinationName = value;
         }
         else
         {