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 2007/04/05 13:47:51 UTC

svn commit: r525800 [1/3] - in /incubator/qpid/trunk/qpid: ./ java/integrationtests/src/main/java/org/apache/qpid/util/ java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ java/perftests/src/main/java/org/apache/qpid/ping/...

Author: rgreig
Date: Thu Apr  5 04:47:50 2007
New Revision: 525800

URL: http://svn.apache.org/viewvc?view=rev&rev=525800
Log:
Merged revisions 522994-523245 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2

........
  r522994 | rgreig | 2007-03-27 17:48:23 +0100 (Tue, 27 Mar 2007) | 1 line
  
  Test added for durability of messages under broker failure.
........
  r523245 | rgreig | 2007-03-28 10:30:49 +0100 (Wed, 28 Mar 2007) | 1 line
  
  Reversed accidental replacing of the word 'initialize' in comments to 'establishConnection' through a method refactoring.
........

Added:
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java
      - copied unchanged from r523245, incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java
Modified:
    incubator/qpid/trunk/qpid/   (props changed)
    incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/util/ClasspathScanner.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java
    incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
    incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingAsyncTestPerf.java
    incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingLatencyTestPerf.java
    incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/ping/PingTestPerf.java
    incubator/qpid/trunk/qpid/java/perftests/src/test/java/org/apache/qpid/requestreply/PingPongTestPerf.java

Propchange: incubator/qpid/trunk/qpid/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/util/ClasspathScanner.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/util/ClasspathScanner.java?view=diff&rev=525800&r1=525799&r2=525800
==============================================================================
--- incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/util/ClasspathScanner.java (original)
+++ incubator/qpid/trunk/qpid/java/integrationtests/src/main/java/org/apache/qpid/util/ClasspathScanner.java Thu Apr  5 04:47:50 2007
@@ -61,10 +61,10 @@
      * @return All the classes that match this collector.
      */
     public static <T> Collection<Class<? extends T>> getMatches(Class<T> matchingClass, String matchingRegexp,
-                                                                boolean beanOnly)
+        boolean beanOnly)
     {
         log.debug("public static <T> Collection<Class<? extends T>> getMatches(Class<T> matchingClass = " + matchingClass
-                  + ", String matchingRegexp = " + matchingRegexp + ", boolean beanOnly = " + beanOnly + "): called");
+            + ", String matchingRegexp = " + matchingRegexp + ", boolean beanOnly = " + beanOnly + "): called");
 
         // Build a compiled regular expression from the pattern to match.
         Pattern matchPattern = Pattern.compile(matchingRegexp);
@@ -95,11 +95,11 @@
      *       iteration.
      */
     private static <T> void gatherFiles(File classRoot, String classFileName, Map<String, Class<? extends T>> result,
-                                        Pattern matchPattern, Class<? extends T> matchClass)
+        Pattern matchPattern, Class<? extends T> matchClass)
     {
         log.debug("private static <T> void gatherFiles(File classRoot = " + classRoot + ", String classFileName = "
-                  + classFileName + ", Map<String, Class<? extends T>> result, Pattern matchPattern = " + matchPattern
-                  + ", Class<? extends T> matchClass = " + matchClass + "): called");
+            + classFileName + ", Map<String, Class<? extends T>> result, Pattern matchPattern = " + matchPattern
+            + ", Class<? extends T> matchClass = " + matchClass + "): called");
 
         File thisRoot = new File(classRoot, classFileName);
 

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java?view=diff&rev=525800&r1=525799&r2=525800
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java Thu Apr  5 04:47:50 2007
@@ -7,9 +7,9 @@
  * 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
@@ -20,8 +20,6 @@
  */
 package org.apache.qpid.management.ui.views;
 
-import static org.apache.qpid.management.ui.Constants.*;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -29,12 +27,14 @@
 import java.util.List;
 
 import org.apache.qpid.management.ui.ApplicationRegistry;
+import static org.apache.qpid.management.ui.Constants.*;
 import org.apache.qpid.management.ui.ManagedBean;
 import org.apache.qpid.management.ui.ManagedServer;
 import org.apache.qpid.management.ui.ServerRegistry;
 import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
 import org.apache.qpid.management.ui.jmx.JMXServerRegistry;
 import org.apache.qpid.management.ui.jmx.MBeanUtility;
+
 import org.eclipse.jface.preference.PreferenceStore;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -48,6 +48,7 @@
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerSorter;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.Image;
@@ -62,6 +63,7 @@
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
+
 import org.eclipse.ui.part.ViewPart;
 
 /**
@@ -71,29 +73,29 @@
  */
 public class NavigationView extends ViewPart
 {
-	public static final String ID = "org.apache.qpid.management.ui.navigationView";    
+    public static final String ID = "org.apache.qpid.management.ui.navigationView";
     public static final String INI_FILENAME = System.getProperty("user.home") + File.separator + "qpidManagementConsole.ini";
-    
+
     private static final String INI_SERVERS = "Servers";
     private static final String INI_QUEUES = QUEUE + "s";
     private static final String INI_CONNECTIONS = CONNECTION + "s";
     private static final String INI_EXCHANGES = EXCHANGE + "s";
-    
+
     private TreeViewer _treeViewer = null;
     private TreeObject _rootNode = null;
     private TreeObject _serversRootNode = null;
-    
+
     private PreferenceStore _preferences;
     // Map of connected servers
     private HashMap<ManagedServer, TreeObject> _managedServerMap = new HashMap<ManagedServer, TreeObject>();
-    
+
     private void createTreeViewer(Composite parent)
     {
         _treeViewer = new TreeViewer(parent);
         _treeViewer.setContentProvider(new ContentProviderImpl());
-        _treeViewer.setLabelProvider(new LabelProviderImpl());        
+        _treeViewer.setLabelProvider(new LabelProviderImpl());
         _treeViewer.setSorter(new ViewerSorterImpl());
-        
+
         // layout the tree viewer below the label field, to cover the area
         GridData layoutData = new GridData();
         layoutData = new GridData();
@@ -103,118 +105,124 @@
         layoutData.verticalAlignment = GridData.FILL;
         _treeViewer.getControl().setLayoutData(layoutData);
         _treeViewer.setUseHashlookup(true);
-        
+
         createListeners();
     }
-    
+
     /**
      * Creates listeners for the JFace treeviewer
      */
     private void createListeners()
     {
-        _treeViewer.addDoubleClickListener(new IDoubleClickListener() {
+        _treeViewer.addDoubleClickListener(new IDoubleClickListener()
+            {
                 public void doubleClick(DoubleClickEvent event)
                 {
-                    IStructuredSelection ss = (IStructuredSelection)event.getSelection();
-                    if (ss == null || ss.getFirstElement() == null)
+                    IStructuredSelection ss = (IStructuredSelection) event.getSelection();
+                    if ((ss == null) || (ss.getFirstElement() == null))
                     {
                         return;
                     }
+
                     boolean state = _treeViewer.getExpandedState(ss.getFirstElement());
                     _treeViewer.setExpandedState(ss.getFirstElement(), !state);
                 }
             });
-        
-        _treeViewer.addTreeListener(new ITreeViewerListener() {
-            public void treeExpanded(TreeExpansionEvent event)
-            {
-                _treeViewer.setExpandedState(event.getElement(), true);
-                // Following will cause the selection event to be sent, so commented
-                //_treeViewer.setSelection(new StructuredSelection(event.getElement()));
-                _treeViewer.refresh();
-            }
 
-            public void treeCollapsed(TreeExpansionEvent event)
+        _treeViewer.addTreeListener(new ITreeViewerListener()
             {
-                _treeViewer.setExpandedState(event.getElement(), false);
-                _treeViewer.refresh();
-            }
-        });
-        
+                public void treeExpanded(TreeExpansionEvent event)
+                {
+                    _treeViewer.setExpandedState(event.getElement(), true);
+                    // Following will cause the selection event to be sent, so commented
+                    // _treeViewer.setSelection(new StructuredSelection(event.getElement()));
+                    _treeViewer.refresh();
+                }
+
+                public void treeCollapsed(TreeExpansionEvent event)
+                {
+                    _treeViewer.setExpandedState(event.getElement(), false);
+                    _treeViewer.refresh();
+                }
+            });
+
         // This listener is for popup menu, which pops up if a queue,exchange or connection is selected
         // with right click.
-        _treeViewer.getTree().addListener(SWT.MenuDetect, new Listener () {
-            Display display = getSite().getShell().getDisplay();
-            final Shell shell = new Shell (display);
-            
-            public void handleEvent(Event event)
-            {
-                Tree widget = (Tree)event.widget;
-                TreeItem[] items = widget.getSelection();
-                if (items == null) return;
-                
-                // Get the selected node
-                final TreeObject selectedNode = (TreeObject)items[0].getData();
-                final TreeObject parentNode = selectedNode.getParent();
-                
-                // This popup is only for mbeans and only connection,exchange and queue types
-                if (parentNode == null ||
-                    !MBEAN.equals(selectedNode.getType()) ||
-                    !(CONNECTION.equals(parentNode.getName()) ||
-                      QUEUE.equals(parentNode.getName()) ||
-                      EXCHANGE.equals(parentNode.getName()))
-                     )
+        _treeViewer.getTree().addListener(SWT.MenuDetect, new Listener()
+            {
+                Display display = getSite().getShell().getDisplay();
+                final Shell shell = new Shell(display);
+
+                public void handleEvent(Event event)
                 {
-                    return;
-                }
-                
-                Menu menu = new Menu (shell, SWT.POP_UP);
-                MenuItem item = new MenuItem (menu, SWT.PUSH);
-                // Add the action item, which will remove the node from the tree if selected
-                item.setText(ACTION_REMOVE_MBEANNODE);
-                item.addListener (SWT.Selection, new Listener () {
-                    public void handleEvent (Event e)
+                    Tree widget = (Tree) event.widget;
+                    TreeItem[] items = widget.getSelection();
+                    if (items == null)
                     {
-                        removeManagedObject(parentNode, (ManagedBean)selectedNode.getManagedObject());
-                        _treeViewer.refresh();
-                        // set the selection to the parent node
-                        _treeViewer.setSelection(new StructuredSelection(parentNode));
+                        return;
                     }
-                });
-                menu.setLocation (event.x, event.y);
-                menu.setVisible (true);
-                while (!menu.isDisposed () && menu.isVisible ())
-                {
-                    if (!display.readAndDispatch ())
+
+                    // Get the selected node
+                    final TreeObject selectedNode = (TreeObject) items[0].getData();
+                    final TreeObject parentNode = selectedNode.getParent();
+
+                    // This popup is only for mbeans and only connection,exchange and queue types
+                    if ((parentNode == null) || !MBEAN.equals(selectedNode.getType())
+                            || !(CONNECTION.equals(parentNode.getName()) || QUEUE.equals(parentNode.getName())
+                                || EXCHANGE.equals(parentNode.getName())))
                     {
-                        display.sleep ();
+                        return;
                     }
+
+                    Menu menu = new Menu(shell, SWT.POP_UP);
+                    MenuItem item = new MenuItem(menu, SWT.PUSH);
+                    // Add the action item, which will remove the node from the tree if selected
+                    item.setText(ACTION_REMOVE_MBEANNODE);
+                    item.addListener(SWT.Selection, new Listener()
+                        {
+                            public void handleEvent(Event e)
+                            {
+                                removeManagedObject(parentNode, (ManagedBean) selectedNode.getManagedObject());
+                                _treeViewer.refresh();
+                                // set the selection to the parent node
+                                _treeViewer.setSelection(new StructuredSelection(parentNode));
+                            }
+                        });
+                    menu.setLocation(event.x, event.y);
+                    menu.setVisible(true);
+                    while (!menu.isDisposed() && menu.isVisible())
+                    {
+                        if (!display.readAndDispatch())
+                        {
+                            display.sleep();
+                        }
+                    }
+
+                    menu.dispose();
                 }
-                menu.dispose ();
-            }
-        });
-    }   
-    
+            });
+    }
+
     /**
      * Creates Qpid Server connection using JMX RMI protocol
      * @param server
      * @throws Exception
      */
     private void createRMIServerConnection(ManagedServer server) throws Exception
-    {     
+    {
         try
         {
             // Currently Qpid Management Console only supports JMX MBeanServer
-            ServerRegistry serverRegistry = new JMXServerRegistry(server);  
-            ApplicationRegistry.addServer(server, serverRegistry);         
+            ServerRegistry serverRegistry = new JMXServerRegistry(server);
+            ApplicationRegistry.addServer(server, serverRegistry);
         }
-        catch(Exception ex)
+        catch (Exception ex)
         {
             ex.printStackTrace();
             throw new Exception("Error in connecting to Qpid broker at " + server.getUrl(), ex);
         }
     }
-    
+
     /**
      * Adds a new server node in the navigation view if server connection is successful.
      * @param transportProtocol
@@ -223,15 +231,15 @@
      * @param domain
      * @throws Exception
      */
-    public void addNewServer(String transportProtocol, String host, int port,
-                             String domain, String user, String pwd) throws Exception
+    public void addNewServer(String transportProtocol, String host, int port, String domain, String user, String pwd)
+        throws Exception
     {
         String serverAddress = host + ":" + port;
         String url = null;
         ManagedServer managedServer = new ManagedServer(host, port, domain, user, pwd);
-        
+
         if ("RMI".equals(transportProtocol))
-        {            
+        {
             url = managedServer.getUrl();
             List<TreeObject> list = _serversRootNode.getChildren();
             for (TreeObject node : list)
@@ -242,10 +250,11 @@
                     // Set the server node as selected and then connect it.
                     _treeViewer.setSelection(new StructuredSelection(node));
                     reconnect(user, pwd);
+
                     return;
                 }
             }
-            
+
             // The server is not in the list of already added servers, so now connect and add it.
             managedServer.setName(serverAddress);
             createRMIServerConnection(managedServer);
@@ -254,28 +263,28 @@
         {
             throw new InfoRequiredException(transportProtocol + " transport is not supported");
         }
-        
+
         // Server connection is successful. Now add the server in the tree
         TreeObject serverNode = new TreeObject(serverAddress, NODE_TYPE_SERVER);
         serverNode.setUrl(url);
         serverNode.setManagedObject(managedServer);
         _serversRootNode.addChild(serverNode);
-        
+
         // Add server in the connected server map
         _managedServerMap.put(managedServer, serverNode);
-        
+
         // populate the server tree
-        populateServer(serverNode); 
-        
+        populateServer(serverNode);
+
         // Add the Queue/Exchanges/Connections from config file into the navigation tree
         addConfiguredItems(managedServer);
-        
+
         _treeViewer.refresh();
-        
-        // save server address in file            
+
+        // save server address in file
         addServerInConfigFile(serverAddress);
     }
-    
+
     /**
      * Create the config file, if it doesn't already exist.
      * Exits the application if the file could not be created.
@@ -290,29 +299,29 @@
                 file.createNewFile();
             }
         }
-        catch(IOException ex)
+        catch (IOException ex)
         {
             System.out.println("Could not write to the file " + INI_FILENAME);
             System.out.println(ex);
             System.exit(1);
         }
     }
-    
+
     /**
      * Server addresses are stored in a file. When user launches the application again, the
      * server addresses are picked up from the file and shown in the navigfation view. This method
-     * adds the server address in a file, when a new server is added in the navigation view. 
+     * adds the server address in a file, when a new server is added in the navigation view.
      * @param serverAddress
      */
     private void addServerInConfigFile(String serverAddress)
     {
         // Check if the address already exists
         List<String> list = getServerListFromFile();
-        if (list != null && list.contains(serverAddress))
+        if ((list != null) && list.contains(serverAddress))
         {
             return;
         }
-        
+
         // Get the existing server list and add to that
         String servers = _preferences.getString(INI_SERVERS);
         String value = (servers.length() != 0) ? (servers + "," + serverAddress) : serverAddress;
@@ -321,12 +330,12 @@
         {
             _preferences.save();
         }
-        catch(IOException ex)
+        catch (IOException ex)
         {
             System.err.println("Could not add " + serverAddress + " in " + INI_SERVERS + " (" + INI_FILENAME + ")");
             System.out.println(ex);
         }
-    }  
+    }
 
     /**
      * Adds the item (Queue/Exchange/Connection) to the config file
@@ -337,20 +346,20 @@
      */
     private void addItemInConfigFile(TreeObject node)
     {
-        ManagedBean mbean = (ManagedBean)node.getManagedObject();
+        ManagedBean mbean = (ManagedBean) node.getManagedObject();
         String server = mbean.getServer().getName();
         String virtualhost = mbean.getVirtualHostName();
         String type = node.getParent().getName() + "s";
         String name = node.getName();
         String itemKey = server + "." + virtualhost + "." + type;
-        
+
         // Check if the item already exists in the config file
         List<String> list = getConfiguredItemsFromFile(itemKey);
-        if (list != null && list.contains(name))
+        if ((list != null) && list.contains(name))
         {
             return;
         }
-        
+
         // Add this item to the existing list of items
         String items = _preferences.getString(itemKey);
         String value = (items.length() != 0) ? (items + "," + name) : name;
@@ -359,21 +368,21 @@
         {
             _preferences.save();
         }
-        catch(IOException ex)
+        catch (IOException ex)
         {
             System.err.println("Could not add " + name + " in " + itemKey + " (" + INI_FILENAME + ")");
             System.out.println(ex);
         }
     }
-    
+
     private void removeItemFromConfigFile(TreeObject node)
     {
-        ManagedBean mbean = (ManagedBean)node.getManagedObject();
+        ManagedBean mbean = (ManagedBean) node.getManagedObject();
         String server = mbean.getServer().getName();
         String vHost = mbean.getVirtualHostName();
         String type = node.getParent().getName() + "s";
         String itemKey = server + "." + vHost + "." + type;
-        
+
         List<String> list = getConfiguredItemsFromFile(itemKey);
         if (list.contains(node.getName()))
         {
@@ -383,29 +392,30 @@
             {
                 value += item + ",";
             }
+
             value = (value.lastIndexOf(",") != -1) ? value.substring(0, value.lastIndexOf(",")) : value;
-            
+
             _preferences.putValue(itemKey, value);
             try
             {
                 _preferences.save();
             }
-            catch(IOException ex)
+            catch (IOException ex)
             {
-                System.err.println("Error in updating the config file "+ INI_FILENAME);
+                System.err.println("Error in updating the config file " + INI_FILENAME);
                 System.out.println(ex);
             }
         }
     }
 
     /**
-     * Queries the qpid server for MBeans and populates the navigation view with all MBeans for 
+     * Queries the qpid server for MBeans and populates the navigation view with all MBeans for
      * the given server node.
      * @param serverNode
      */
     private void populateServer(TreeObject serverNode)
     {
-        ManagedServer server = (ManagedServer)serverNode.getManagedObject();
+        ManagedServer server = (ManagedServer) serverNode.getManagedObject();
         String domain = server.getDomain();
         try
         {
@@ -414,29 +424,30 @@
                 TreeObject domainNode = new TreeObject(domain, NODE_TYPE_DOMAIN);
                 domainNode.setParent(serverNode);
 
-                populateDomain(domainNode); 
+                populateDomain(domainNode);
             }
             else
             {
                 List<TreeObject> domainList = new ArrayList<TreeObject>();
-                List<String> domains = MBeanUtility.getAllDomains(server);;           
+                List<String> domains = MBeanUtility.getAllDomains(server);
+                ;
                 for (String domainName : domains)
-                {       
+                {
                     TreeObject domainNode = new TreeObject(domainName, NODE_TYPE_DOMAIN);
                     domainNode.setParent(serverNode);
 
                     domainList.add(domainNode);
-                    populateDomain(domainNode);               
+                    populateDomain(domainNode);
                 }
             }
         }
-        catch(Exception ex)
+        catch (Exception ex)
         {
             System.out.println("\nError in connecting to Qpid broker ");
             ex.printStackTrace();
         }
     }
-    
+
     /**
      * Queries the Qpid Server and populates the given domain node with all MBeans undser that domain.
      * @param domain
@@ -446,19 +457,19 @@
     @SuppressWarnings("unchecked")
     private void populateDomain(TreeObject domain) throws IOException, Exception
     {
-        ManagedServer server = (ManagedServer)domain.getParent().getManagedObject();
-        
+        ManagedServer server = (ManagedServer) domain.getParent().getManagedObject();
+
         // Now populate the mbenas under those types
         List<ManagedBean> mbeans = MBeanUtility.getManagedObjectsForDomain(server, domain.getName());
         for (ManagedBean mbean : mbeans)
         {
             mbean.setServer(server);
             ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(server);
-            serverRegistry.addManagedObject(mbean);     
-            
+            serverRegistry.addManagedObject(mbean);
+
             // Add all mbeans other than Connections, Exchanges and Queues. Because these will be added
-            // manually by selecting from MBeanView           
-            if (!(mbean.isConnection() || mbean.isExchange() || mbean.isQueue()) )
+            // manually by selecting from MBeanView
+            if (!(mbean.isConnection() || mbean.isExchange() || mbean.isQueue()))
             {
                 addManagedBean(domain, mbean);
             }
@@ -471,10 +482,11 @@
             {
                 addDefaultNodes(domain);
             }
+
             break;
         }
     }
-    
+
     /**
      * Add these three types - Connection, Exchange, Queue
      * By adding these, these will always be available, even if there are no mbeans under thse types
@@ -493,7 +505,7 @@
         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.
@@ -506,24 +518,30 @@
         List<TreeObject> childNodes = parent.getChildren();
         for (TreeObject child : childNodes)
         {
-            if ((NODE_TYPE_MBEANTYPE.equals(child.getType()) || NODE_TYPE_TYPEINSTANCE.equals(child.getType())) &&
-                 typeName.equals(child.getName()))
+            if ((NODE_TYPE_MBEANTYPE.equals(child.getType()) || NODE_TYPE_TYPEINSTANCE.equals(child.getType()))
+                    && typeName.equals(child.getName()))
+            {
                 return child;
+            }
         }
+
         return null;
     }
-    
+
     private boolean doesMBeanNodeAlreadyExist(TreeObject typeNode, String mbeanName)
     {
         List<TreeObject> childNodes = typeNode.getChildren();
         for (TreeObject child : childNodes)
         {
             if (MBEAN.equals(child.getType()) && mbeanName.equals(child.getName()))
+            {
                 return true;
+            }
         }
+
         return false;
     }
-    
+
     /**
      * Adds the given MBean to the given domain node. Creates Notification node for the MBean.
      * sample ObjectNames -
@@ -533,18 +551,18 @@
      * @param mbean
      * @throws Exception
      */
-    private void addManagedBean(TreeObject domain, ManagedBean mbean)// throws Exception
+    private void addManagedBean(TreeObject domain, ManagedBean mbean) // throws Exception
     {
         String name = mbean.getName();
         // Split the mbean type into array of Strings, to create hierarchy
         // eg. type=VirtualHost.VirtualHostManager,VirtualHost=localhost will be:
-        //     localhost->VirtualHostManager 
+        // localhost->VirtualHostManager
         // eg. type=org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,name=ping will be:
-        //     test->Queue->ping
+        // test->Queue->ping
         String[] types = mbean.getType().split("\\.");
         TreeObject typeNode = null;
         TreeObject parentNode = domain;
-        
+
         // Run this loop till all nodes(hierarchy) for this mbean are created. This loop only creates
         // all the required parent nodes for the mbean
         for (int i = 0; i < types.length; i++)
@@ -554,34 +572,34 @@
             // If value is not null, then there will be a parent node for this mbean
             // eg. for type=VirtualHost the value is "test"
             typeNode = getMBeanTypeNode(parentNode, type);
-            
+
             // create the type node if not already created
             if (typeNode == null)
             {
                 // 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))
+                if ((name == null) && (i == (types.length - 1)))
                 {
                     break;
                 }
-                
+
                 // create a node for "type"
                 typeNode = createTypeNode(parentNode, type);
                 typeNode.setVirtualHost(mbean.getVirtualHostName());
             }
-            
+
             // now type node create becomes the parent node for next node in hierarchy
             parentNode = typeNode;
-            
-            /* 
+
+            /*
              * Now create instances node for this type if value exists.
              */
-            if (valueOftype == null) 
+            if (valueOftype == null)
             {
-                // No instance node will be created when value is null (eg type=Queue) 
+                // No instance node will be created when value is null (eg type=Queue)
                 break;
-            } 
-            
+            }
+
             // For different virtual hosts, the nodes with given value will be created.
             // eg type=VirtualHost, value=test
             typeNode = getMBeanTypeNode(parentNode, valueOftype);
@@ -589,55 +607,60 @@
             {
                 typeNode = createTypeInstanceNode(parentNode, valueOftype);
                 typeNode.setVirtualHost(mbean.getVirtualHostName());
-                
+
                 // Create default nodes for VHost instances
                 if (type.equals(VIRTUAL_HOST))
                 {
                     addDefaultNodes(typeNode);
                 }
             }
+
             parentNode = typeNode;
         }
-        
+
         if (typeNode == null)
         {
             typeNode = parentNode;
         }
-        
+
         // Check if an MBean is already added
         if (doesMBeanNodeAlreadyExist(typeNode, name))
+        {
             return;
-        
+        }
+
         // Add the mbean node now
         TreeObject mbeanNode = new TreeObject(mbean);
         mbeanNode.setParent(typeNode);
-        
+
         // Add the mbean to the config file
         if (mbean.isQueue() || mbean.isExchange() || mbean.isConnection())
         {
             addItemInConfigFile(mbeanNode);
         }
-        
+
         // Add notification node
         // TODO: show this only if the mbean sends any notification
         TreeObject notificationNode = new TreeObject(NOTIFICATION, NOTIFICATION);
         notificationNode.setParent(mbeanNode);
     }
-    
+
     private TreeObject createTypeNode(TreeObject parent, String name)
     {
         TreeObject typeNode = new TreeObject(name, NODE_TYPE_MBEANTYPE);
         typeNode.setParent(parent);
+
         return typeNode;
     }
-    
+
     private TreeObject createTypeInstanceNode(TreeObject parent, String name)
     {
         TreeObject typeNode = new TreeObject(name, NODE_TYPE_TYPEINSTANCE);
         typeNode.setParent(parent);
+
         return typeNode;
     }
-    
+
     /**
      * Removes all the child nodes of the given parent node. Used when closing a server.
      * @param parent
@@ -649,7 +672,7 @@
         {
             removeManagedObject(child);
         }
-        
+
         list.clear();
     }
 
@@ -666,10 +689,11 @@
         {
             if (MBEAN.equals(child.getType()))
             {
-                String name = mbean.getName() != null ? mbean.getName() : mbean.getType();
+                String name = (mbean.getName() != null) ? mbean.getName() : mbean.getType();
                 if (child.getName().equals(name))
                 {
                     objectToRemove = child;
+
                     break;
                 }
             }
@@ -678,35 +702,39 @@
                 removeManagedObject(child, mbean);
             }
         }
-        
+
         if (objectToRemove != null)
         {
             list.remove(objectToRemove);
             removeItemFromConfigFile(objectToRemove);
         }
-        
+
     }
-    
+
     /**
      * Closes the Qpid server connection
      */
     public void disconnect() throws Exception
     {
-        TreeObject selectedNode = getSelectedServerNode();        
-        ManagedServer managedServer = (ManagedServer)selectedNode.getManagedObject();
+        TreeObject selectedNode = getSelectedServerNode();
+        ManagedServer managedServer = (ManagedServer) selectedNode.getManagedObject();
         if (!_managedServerMap.containsKey(managedServer))
+        {
             return;
+        }
 
         // Close server connection
         ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(managedServer);
-        if (serverRegistry == null)  // server connection is already closed
+        if (serverRegistry == null) // server connection is already closed
+        {
             return;
-        
+        }
+
         serverRegistry.closeServerConnection();
         // Add server to the closed server list and the worker thread will remove the server from required places.
         ApplicationRegistry.serverConnectionClosed(managedServer);
     }
-    
+
     /**
      * Connects the selected server node
      * @throws Exception
@@ -714,27 +742,28 @@
     public void reconnect(String user, String password) throws Exception
     {
         TreeObject selectedNode = getSelectedServerNode();
-        ManagedServer managedServer = (ManagedServer)selectedNode.getManagedObject();
-        if(_managedServerMap.containsKey(managedServer))
+        ManagedServer managedServer = (ManagedServer) selectedNode.getManagedObject();
+        if (_managedServerMap.containsKey(managedServer))
         {
             throw new InfoRequiredException("Server " + managedServer.getName() + " is already connected");
-        }   
+        }
+
         managedServer.setUser(user);
         managedServer.setPassword(password);
         createRMIServerConnection(managedServer);
-        
+
         // put the server in the managed server map
         _managedServerMap.put(managedServer, selectedNode);
-        
+
         // populate the server tree now
         populateServer(selectedNode);
-        
+
         // Add the Queue/Exchanges/Connections from config file into the navigation tree
         addConfiguredItems(managedServer);
-        
-        _treeViewer.refresh();  
+
+        _treeViewer.refresh();
     }
-    
+
     /**
      * Adds the items(queues/exchanges/connectins) from config file to the server tree
      * @param server
@@ -750,13 +779,13 @@
             List<String> items = getConfiguredItemsFromFile(itemKey);
             List<ManagedBean> mbeans = serverRegistry.getQueues(virtualHost);
             addConfiguredItems(items, mbeans);
-            
+
             // Add Exchanges
             itemKey = server.getName() + "." + virtualHost + "." + INI_EXCHANGES;
             items = getConfiguredItemsFromFile(itemKey);
             mbeans = serverRegistry.getExchanges(virtualHost);
             addConfiguredItems(items, mbeans);
-            
+
             // Add Connections
             itemKey = server.getName() + "." + virtualHost + "." + INI_CONNECTIONS;
             items = getConfiguredItemsFromFile(itemKey);
@@ -764,7 +793,7 @@
             addConfiguredItems(items, mbeans);
         }
     }
-    
+
     /**
      * Gets the mbeans corresponding to the items and adds those to the navigation tree
      * @param items
@@ -772,11 +801,11 @@
      */
     private void addConfiguredItems(List<String> items, List<ManagedBean> mbeans)
     {
-        if ((items == null) || items.isEmpty() | (mbeans == null) || mbeans.isEmpty())
+        if ((items == null) || (items.isEmpty() | (mbeans == null)) || mbeans.isEmpty())
         {
             return;
         }
-        
+
         for (String item : items)
         {
             for (ManagedBean mbean : mbeans)
@@ -784,12 +813,13 @@
                 if (item.equals(mbean.getName()))
                 {
                     addManagedBean(mbean);
+
                     break;
                 }
             }
         }
     }
-    
+
     /**
      * Closes the Qpid server connection if not already closed and removes the server node from the navigation view and
      * also from the ini file stored in the system.
@@ -798,9 +828,9 @@
     public void removeServer() throws Exception
     {
         disconnect();
-        
+
         // Remove from the Tree
-        String serverNodeName = getSelectedServerNode().getName();        
+        String serverNodeName = getSelectedServerNode().getName();
         List<TreeObject> list = _serversRootNode.getChildren();
         TreeObject objectToRemove = null;
         for (TreeObject child : list)
@@ -808,46 +838,48 @@
             if (child.getName().equals(serverNodeName))
             {
                 objectToRemove = child;
+
                 break;
             }
         }
-        
+
         if (objectToRemove != null)
         {
             list.remove(objectToRemove);
         }
-        
+
         _treeViewer.refresh();
-        
+
         // Remove from the ini file
         removeServerFromConfigFile(serverNodeName);
     }
-    
+
     private void removeServerFromConfigFile(String serverNodeName)
     {
         List<String> serversList = getServerListFromFile();
         serversList.remove(serverNodeName);
-        
+
         String value = "";
         for (String item : serversList)
         {
             value += item + ",";
         }
+
         value = (value.lastIndexOf(",") != -1) ? value.substring(0, value.lastIndexOf(",")) : value;
-        
+
         _preferences.putValue(INI_SERVERS, value);
-        
+
         try
         {
             _preferences.save();
         }
-        catch(IOException ex)
+        catch (IOException ex)
         {
-            System.err.println("Error in updating the config file "+ INI_FILENAME);
+            System.err.println("Error in updating the config file " + INI_FILENAME);
             System.out.println(ex);
         }
     }
-    
+
     /**
      * @return the server addresses from the ini file
      * @throws Exception
@@ -856,7 +888,7 @@
     {
         return getConfiguredItemsFromFile(INI_SERVERS);
     }
-    
+
     /**
      * Returns the list of items from the config file.
      * sample ini file:
@@ -879,59 +911,60 @@
                 list.add(item);
             }
         }
-        
+
         return list;
     }
-    
+
     public TreeObject getSelectedServerNode() throws Exception
     {
-        IStructuredSelection ss = (IStructuredSelection)_treeViewer.getSelection();
-        TreeObject selectedNode = (TreeObject)ss.getFirstElement();
-        if (ss.isEmpty() || selectedNode == null || (!selectedNode.getType().equals(NODE_TYPE_SERVER)))
+        IStructuredSelection ss = (IStructuredSelection) _treeViewer.getSelection();
+        TreeObject selectedNode = (TreeObject) ss.getFirstElement();
+        if (ss.isEmpty() || (selectedNode == null) || (!selectedNode.getType().equals(NODE_TYPE_SERVER)))
         {
             throw new InfoRequiredException("Please select the server");
         }
 
         return selectedNode;
     }
-	/**
+
+    /**
      * This is a callback that will allow us to create the viewer and initialize
      * it.
      */
-	public void createPartControl(Composite parent)
+    public void createPartControl(Composite parent)
     {
         Composite composite = new Composite(parent, SWT.NONE);
         GridLayout gridLayout = new GridLayout();
         gridLayout.marginHeight = 2;
         gridLayout.marginWidth = 2;
-        gridLayout.horizontalSpacing = 0; 
-        gridLayout.verticalSpacing = 2;        
+        gridLayout.horizontalSpacing = 0;
+        gridLayout.verticalSpacing = 2;
         composite.setLayout(gridLayout);
-        
+
         createTreeViewer(composite);
         _rootNode = new TreeObject("ROOT", "ROOT");
         _serversRootNode = new TreeObject(NAVIGATION_ROOT, "ROOT");
         _serversRootNode.setParent(_rootNode);
-        
+
         _treeViewer.setInput(_rootNode);
         // set viewer as selection event provider for MBeanView
-        getSite().setSelectionProvider(_treeViewer);      
-        
+        getSite().setSelectionProvider(_treeViewer);
+
         // Start worker thread to refresh tree for added or removed objects
-        (new Thread(new Worker())).start();     
- 
+        (new Thread(new Worker())).start();
+
         createConfigFile();
         _preferences = new PreferenceStore(INI_FILENAME);
-        
+
         try
         {
             _preferences.load();
         }
-        catch(IOException ex)
+        catch (IOException ex)
         {
             System.out.println(ex);
         }
-        
+
         // load the list of servers already added from file
         List<String> serversList = getServerListFromFile();
         if (serversList != null)
@@ -945,23 +978,22 @@
                 _serversRootNode.addChild(serverNode);
             }
         }
+
         _treeViewer.refresh();
-        
-	}
 
-	/**
-	 * Passing the focus request to the viewer's control.
-	 */
-	public void setFocus()
-    {
+    }
+
+    /**
+     * Passing the focus request to the viewer's control.
+     */
+    public void setFocus()
+    { }
 
-	}
-    
     public void refresh()
     {
         _treeViewer.refresh();
     }
-    
+
     /**
      * Content provider class for the tree viewer
      */
@@ -971,36 +1003,39 @@
         {
             return getChildren(parent);
         }
-        
+
         public Object[] getChildren(final Object parentElement)
         {
-            final TreeObject node = (TreeObject)parentElement;
+            final TreeObject node = (TreeObject) parentElement;
+
             return node.getChildren().toArray(new TreeObject[0]);
         }
-        
+
         public Object getParent(final Object element)
         {
-            final TreeObject node = (TreeObject)element;
+            final TreeObject node = (TreeObject) element;
+
             return node.getParent();
         }
-        
+
         public boolean hasChildren(final Object element)
         {
             final TreeObject node = (TreeObject) element;
+
             return !node.getChildren().isEmpty();
         }
-        
+
         public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput)
         {
             // Do nothing
         }
-        
+
         public void dispose()
         {
             // Do nothing
         }
     }
-    
+
     /**
      * Label provider class for the tree viewer
      */
@@ -1008,28 +1043,32 @@
     {
         public Image getImage(Object element)
         {
-            TreeObject node = (TreeObject)element;
+            TreeObject node = (TreeObject) element;
             if (node.getType().equals(NOTIFICATION))
             {
                 return ApplicationRegistry.getImage(NOTIFICATION_IMAGE);
             }
             else if (!node.getType().equals(MBEAN))
             {
-               if (_treeViewer.getExpandedState(node))
-                   return ApplicationRegistry.getImage(OPEN_FOLDER_IMAGE);
-               else
-                   return ApplicationRegistry.getImage(CLOSED_FOLDER_IMAGE);
-                   
+                if (_treeViewer.getExpandedState(node))
+                {
+                    return ApplicationRegistry.getImage(OPEN_FOLDER_IMAGE);
+                }
+                else
+                {
+                    return ApplicationRegistry.getImage(CLOSED_FOLDER_IMAGE);
+                }
+
             }
             else
             {
                 return ApplicationRegistry.getImage(MBEAN_IMAGE);
             }
         }
-        
+
         public String getText(Object element)
         {
-            TreeObject node = (TreeObject)element;
+            TreeObject node = (TreeObject) element;
             if (node.getType().equals(NODE_TYPE_MBEANTYPE))
             {
                 return node.getName() + "s";
@@ -1039,35 +1078,42 @@
                 return node.getName();
             }
         }
-        
+
         public Font getFont(Object element)
         {
-            TreeObject node = (TreeObject)element;
+            TreeObject node = (TreeObject) element;
             if (node.getType().equals(NODE_TYPE_SERVER))
             {
                 if (node.getChildren().isEmpty())
+                {
                     return ApplicationRegistry.getFont(FONT_NORMAL);
+                }
                 else
+                {
                     return ApplicationRegistry.getFont(FONT_BOLD);
+                }
             }
+
             return ApplicationRegistry.getFont(FONT_NORMAL);
         }
     } // End of LabelProviderImpl
-    
-    
+
     private class ViewerSorterImpl extends ViewerSorter
     {
         public int category(Object element)
         {
-            TreeObject node = (TreeObject)element;
+            TreeObject node = (TreeObject) element;
             if (node.getType().equals(MBEAN))
+            {
                 return 1;
+            }
+
             return 2;
         }
     }
-            
+
     /**
-     * Worker thread, which keeps looking for new ManagedObjects to be added and 
+     * Worker thread, which keeps looking for new ManagedObjects to be added and
      * unregistered objects to be removed from the tree.
      * @author Bhupendra Bhardwaj
      */
@@ -1075,33 +1121,31 @@
     {
         public void run()
         {
-            while(true)
+            while (true)
             {
                 if (!_managedServerMap.isEmpty())
                 {
-                    refreshRemovedObjects();                               
+                    refreshRemovedObjects();
                     refreshClosedServerConnections();
                 }
-                
+
                 try
                 {
                     Thread.sleep(3000);
                 }
-                catch(Exception ex)
-                {
+                catch (Exception ex)
+                { }
+
+            } // end of while loop
+        } // end of run method.
+    } // end of Worker class
 
-                }                          
-                                                
-            }// end of while loop
-        }// end of run method.        
-    }// end of Worker class
-    
     /**
      * Adds the mbean to the navigation tree
      * @param mbean
      * @throws Exception
      */
-    public void addManagedBean(ManagedBean mbean)// throws Exception
+    public void addManagedBean(ManagedBean mbean) // throws Exception
     {
         TreeObject treeServerObject = _managedServerMap.get(mbean.getServer());
         List<TreeObject> domains = treeServerObject.getChildren();
@@ -1111,22 +1155,25 @@
             if (child.getName().equals(mbean.getDomain()))
             {
                 domain = child;
+
                 break;
             }
         }
-        
+
         addManagedBean(domain, mbean);
         _treeViewer.refresh();
     }
-    
+
     private void refreshRemovedObjects()
     {
         for (ManagedServer server : _managedServerMap.keySet())
         {
             final ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(server);
-            if (serverRegistry == null)  // server connection is closed
+            if (serverRegistry == null) // server connection is closed
+            {
                 continue;
-            
+            }
+
             final List<ManagedBean> removalList = serverRegistry.getObjectsToBeRemoved();
             if (removalList != null)
             {
@@ -1145,19 +1192,22 @@
                                     if (child.getName().equals(mbean.getDomain()))
                                     {
                                         domain = child;
+
                                         break;
                                     }
                                 }
+
                                 removeManagedObject(domain, mbean);
-                                //serverRegistry.removeManagedObject(mbean);
+                                // serverRegistry.removeManagedObject(mbean);
                             }
+
                             _treeViewer.refresh();
                         }
                     });
             }
         }
     }
-    
+
     /**
      * Gets the list of closed server connection from the ApplicationRegistry and then removes
      * the closed server nodes from the navigation view
@@ -1169,20 +1219,20 @@
         {
             Display display = getSite().getShell().getDisplay();
             display.syncExec(new Runnable()
-            {
-                public void run()
                 {
-                    for (ManagedServer server : closedServers)
+                    public void run()
                     {
-                        removeManagedObject(_managedServerMap.get(server));
-                        _managedServerMap.remove(server);
-                        ApplicationRegistry.removeServer(server);
+                        for (ManagedServer server : closedServers)
+                        {
+                            removeManagedObject(_managedServerMap.get(server));
+                            _managedServerMap.remove(server);
+                            ApplicationRegistry.removeServer(server);
+                        }
+
+                        _treeViewer.refresh();
                     }
-                    
-                    _treeViewer.refresh();
-                }
-            });
+                });
         }
     }
-    
-}
\ No newline at end of file
+
+}

Modified: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java?view=diff&rev=525800&r1=525799&r2=525800
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java (original)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java Thu Apr  5 04:47:50 2007
@@ -21,6 +21,7 @@
 package org.apache.qpid.ping;
 
 import java.util.List;
+import java.util.Properties;
 
 import javax.jms.Destination;
 
@@ -31,54 +32,36 @@
  * to send replies to its pings. It simply listens to its own ping destinations, rather than seperate reply queues.
  * It is an all in one ping client, that produces and consumes its own pings.
  *
+ * <p/>The constructor increments a count of the number of ping clients created. It is assumed that where many
+ * are created they will all be run in parallel and be active in sending and consuming pings at the same time.
+ * If the unique destinations flag is not set and a pub/sub ping cycle is being run, this means that they will all hear
+ * pings sent by each other. The expected number of pings received will therefore be multiplied up by the number of
+ * active ping clients. The {@link #getConsumersPerTopic()} method is used to supply this multiplier under these
+ * conditions.
+ *
  * <p/><table id="crc"><caption>CRC Card</caption>
  * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create a ping pong producer that listens to its own pings <td> {@link PingPongProducer}
+ * <tr><td> Create a ping producer that listens to its own pings <td> {@link PingPongProducer}
+ * <tr><td> Count the number of ping producers and produce multiplier for scaling up messages expected over topic pings.
  * </table>
  */
 public class PingClient extends PingPongProducer
 {
+    /** Used to count the number of ping clients created. */
     private static int _pingClientCount;
 
     /**
-     * Creates a ping producer with the specified parameters, of which there are many. See their individual comments
-     * for details. This constructor creates ping pong producer but de-registers its reply-to destination message
-     * listener, and replaces it by listening to all of its ping destinations.
+     * Creates a ping producer with the specified parameters, of which there are many. See the class level comments
+     * for {@link PingPongProducer} for details. This constructor creates a connection to the broker and creates
+     * producer and consumer sessions on it, to send and recieve its pings and replies on.
      *
-     * @param brokerDetails    The URL of the broker to send pings to.
-     * @param username         The username to log onto the broker with.
-     * @param password         The password to log onto the broker with.
-     * @param virtualpath      The virtual host name to use on the broker.
-     * @param destinationName  The name (or root where multiple destinations are used) of the desitination to send
-     *                         pings to.
-     * @param selector         The selector to filter replies with.
-     * @param transacted       Indicates whether or not pings are sent and received in transactions.
-     * @param persistent       Indicates whether pings are sent using peristent delivery.
-     * @param messageSize      Specifies the size of ping messages to send.
-     * @param verbose          Indicates that information should be printed to the console on every ping.
-     * @param afterCommit      Indicates that the user should be promted to terminate a broker after commits to test failover.
-     * @param beforeCommit     Indicates that the user should be promted to terminate a broker before commits to test failover.
-     * @param afterSend        Indicates that the user should be promted to terminate a broker after sends to test failover.
-     * @param beforeSend       Indicates that the user should be promted to terminate a broker before sends to test failover.
-     * @param failOnce         Indicates that the failover testing behaviour should only happen on the first commit, not all.
-     * @param txBatchSize      Specifies the number of pings to send in each transaction.
-     * @param noOfDestinations The number of destinations to ping. Must be 1 or more.
-     * @param rate             Specified the number of pings per second to send. Setting this to 0 means send as fast as
-     *                         possible, with no rate restriction.
-     * @param pubsub           True to ping topics, false to ping queues.
-     * @param unique           True to use unique destinations for each ping pong producer, false to share.
+     * @param  overrides Properties containing any desired overrides to the defaults.
      *
      * @throws Exception Any exceptions are allowed to fall through.
      */
-    public PingClient(String brokerDetails, String username, String password, String virtualpath, String destinationName,
-                      String selector, boolean transacted, boolean persistent, int messageSize, boolean verbose,
-                      boolean afterCommit, boolean beforeCommit, boolean afterSend, boolean beforeSend, boolean failOnce,
-                      int txBatchSize, int noOfDestinations, int rate, boolean pubsub, boolean unique,
-                      int ackMode, long pausetime) throws Exception
+    public PingClient(Properties overrides) throws Exception
     {
-        super(brokerDetails, username, password, virtualpath, destinationName, selector, transacted, persistent, messageSize,
-              verbose, afterCommit, beforeCommit, afterSend, beforeSend, failOnce, txBatchSize, noOfDestinations, rate,
-              pubsub, unique, ackMode, pausetime);
+        super(overrides);
 
         _pingClientCount++;
     }
@@ -94,6 +77,11 @@
         return _pingDestinations;
     }
 
+    /**
+     * Supplies the multiplier for the number of ping clients that will hear each ping when doing pub/sub pinging.
+     *
+     * @return The scaling up of the number of expected pub/sub pings.
+     */
     public int getConsumersPerTopic()
     {
         if (_isUnique)