You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by bh...@apache.org on 2007/01/04 11:52:07 UTC

svn commit: r492514 - in /incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui: ./ jmx/ model/ views/

Author: bhupendrab
Date: Thu Jan  4 02:52:06 2007
New Revision: 492514

URL: http://svn.apache.org/viewvc?view=rev&rev=492514
Log:
QPID-213

Modified:
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
    incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java?view=diff&rev=492514&r1=492513&r2=492514
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java Thu Jan  4 02:52:06 2007
@@ -39,6 +39,8 @@
     public final static String NOTIFICATION = "Notifications";
     public final static String RESULT = "Result";
     
+    public final static String ATTRIBUTE_QUEUE_DEPTH = "QueueDepth"; 
+    
     public final static String ALL = "All";
     
     public final static String NAVIGATION_ROOT = "Qpid Connections";

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java?view=diff&rev=492514&r1=492513&r2=492514
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java Thu Jan  4 02:52:06 2007
@@ -176,7 +176,7 @@
         {
             ViewUtility.popupErrorMessage(mbean.getName(), ex.toString());
         }
-        //ex.printStackTrace();
+        ex.printStackTrace();
     }
     
     /**
@@ -207,7 +207,36 @@
         serverRegistry.removeNotificationListener(mbean, name, type);
     }
     
-    public static int refreshAttribute(ManagedBean mbean, String attribute) throws Exception
+    /**
+     * Checks if the server registry contains attribute information for this mbean. If not then it queries the
+     * mbean server for complete mbean information, else it gets the latest value of the given attribute
+     * from mbean server.
+     * @return attribute data for the given mbean attribute
+     */
+    public static AttributeData getAttributeData(ManagedBean mbean, String attribute) throws Exception
+    {
+        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
+        ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
+        if (attributeModel == null)
+        {
+            // If process is here, it means the mbeanInfo is not retrieved from mbean server even once for this mbean
+            getMBeanInfo(mbean);
+        }
+        else
+        {
+            // refresh attribute value from mbean server
+            refreshAttribute(mbean, attribute);
+        }
+        attributeModel = serverRegistry.getAttributeModel(mbean);
+        return attributeModel.getAttribute(attribute);
+    }
+    
+    /**
+     * Retrieves the latest attribute value from mbean server for the given mbean attribute
+     * and also sets that value in the attribute model in the server registry
+     * @return latest attribute value for the given mbean attribute
+     */
+    public static Object refreshAttribute(ManagedBean mbean, String attribute) throws Exception
     {
         JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
         MBeanServerConnection mbsc = serverRegistry.getServerConnection();
@@ -218,10 +247,10 @@
         }
         
         Object value = mbsc.getAttribute(((JMXManagedObject)mbean).getObjectName(), attribute);
-        
+        // update the attribute data in server registry for this attribute
         ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
         attributeModel.setAttributeValue(attribute, value);
-        return Integer.parseInt(String.valueOf(value));
+        return value;
     }
     
     /**
@@ -240,9 +269,12 @@
         MBeanServerConnection mbsc = serverRegistry.getServerConnection();
         MBeanAttributeInfo[] attributesInfo = null;
         ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
-        // If retrieving attributeInfo for the first time.
+        
         if (attributeModel == null)
         {
+            // If the process is here, then it means the attribute values are not retrieved from mbean server
+            // even once for this mbean. Create attribute model, retrieve values from mbean server and 
+            // set the attribute model in server registry for this mbean
             attributeModel = new ManagedAttributeModel();
             attributesInfo = serverRegistry.getMBeanInfo(mbean).getAttributes();
             attributes = new String[attributesInfo.length];
@@ -314,8 +346,8 @@
         OperationDataModel dataModel = serverRegistry.getOperationModel(mbean);
         if (dataModel == null)
         {
-            MBeanInfo mbeanInfo = serverRegistry.getMBeanInfo(mbean);
-            MBeanOperationInfo[] operationsInfo = mbeanInfo.getOperations();
+            // Create operation model and set it in server registry for this mbean
+            MBeanOperationInfo[] operationsInfo = serverRegistry.getMBeanInfo(mbean).getOperations();
             dataModel = new OperationDataModel();
             
             for (int i = 0; i < operationsInfo.length; i++)
@@ -325,7 +357,6 @@
             
             serverRegistry.setOperationModel(mbean, dataModel);
         }
-        
         return dataModel;
     }
     
@@ -336,15 +367,15 @@
      */
     public static NotificationInfoModel[] getNotificationInfo(ManagedBean mbean)
     {
-        
         JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
         MBeanNotificationInfo[] info = serverRegistry.getMBeanInfo(mbean).getNotifications();
         
+        // Check if this mbean sends any notification
         if (info == null || info.length == 0)
             return null;
         
+        // Create notification model if not already set in the server registry for this mbean
         List<NotificationInfoModel> list = serverRegistry.getNotificationInfo(mbean);
-        
         if (list != null) 
             return list.toArray(new NotificationInfoModel[0]);
         else
@@ -354,11 +385,16 @@
         {
             list.add(new NotificationInfoModel(info[i].getName(), info[i].getDescription(), info[i].getNotifTypes()));
         }
-        serverRegistry.setNotificationInfo(mbean, list);
         
+        // Set the notification model in the server registry for this mbean
+        serverRegistry.setNotificationInfo(mbean, list);
         return list.toArray(new NotificationInfoModel[0]);
     }
     
+    /**
+     * Retrieves all the MBeans from mbean server for a given domain
+     * @return list of ManagedBeans
+     */
     public static List<ManagedBean> getManagedObjectsForDomain(ManagedServer server, String domain) throws Exception
     {
         List<ManagedBean> mbeans = new ArrayList<ManagedBean>();
@@ -377,6 +413,10 @@
         return mbeans;
     }
     
+    /**
+     * Returns all the domains for the given server. This method can be removed as now this RCP is specific to 
+     * Qpid and domain is also fixed
+     */
     public static List<String> getAllDomains(ManagedServer server) throws Exception
     {
         JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java?view=diff&rev=492514&r1=492513&r2=492514
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java Thu Jan  4 02:52:06 2007
@@ -106,6 +106,11 @@
         return _attributeMap.values().toArray(new AttributeData[0]);
     }
     
+    public AttributeData getAttribute(String name)
+    {
+        return _attributeMap.get(name);
+    }
+    
     public int getCount()
     {
         return _attributeMap.size();

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java?view=diff&rev=492514&r1=492513&r2=492514
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java Thu Jan  4 02:52:06 2007
@@ -126,7 +126,7 @@
         _tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
         _tableComposite.setLayout(new GridLayout());
         _buttonsComposite = _toolkit.createComposite(_form.getBody());
-        _tableComposite.setLayoutData(new GridData());
+        _buttonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
         _buttonsComposite.setLayout(new GridLayout());
         
         image = Display.getCurrent().getSystemImage(SWT.ICON_INFORMATION);
@@ -175,7 +175,6 @@
     
     /**
      * Creates tableviewer for the attribute's table
-     *
      */
     private void createTableViewer()
     {
@@ -200,7 +199,7 @@
         // Create and configure the button for attribute details
         _detailsButton = _toolkit.createButton(_buttonsComposite, Constants.BUTTON_DETAILS, SWT.PUSH | SWT.CENTER);
         _detailsButton.setFont(ApplicationRegistry.getFont(Constants.FONT_BUTTON));
-        GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
+        GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
         gridData.widthHint = 80;
         _detailsButton.setLayoutData(gridData);
         _detailsButton.addSelectionListener(new SelectionAdapter()
@@ -225,7 +224,7 @@
         // Create and configure the button for editing attribute
         _editButton = _toolkit.createButton(_buttonsComposite, Constants.BUTTON_EDIT_ATTRIBUTE, SWT.PUSH | SWT.CENTER);
         _editButton.setFont(ApplicationRegistry.getFont(Constants.FONT_BUTTON));
-        GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
+        GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
         gridData.widthHint = 80;
         _editButton.setLayoutData(gridData);
         _editButton.addSelectionListener(new SelectionAdapter()
@@ -247,7 +246,7 @@
     {
         _graphButton = _toolkit.createButton(_buttonsComposite, Constants.BUTTON_GRAPH, SWT.PUSH | SWT.CENTER);
         _graphButton.setFont(ApplicationRegistry.getFont(Constants.FONT_BUTTON));
-        GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
+        GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
         gridData.widthHint = 80;
         _graphButton.setLayoutData(gridData);
         _graphButton.addSelectionListener(new SelectionAdapter()
@@ -270,7 +269,7 @@
         _refreshButton = _toolkit.createButton(_buttonsComposite, Constants.BUTTON_REFRESH, SWT.PUSH | SWT.CENTER);
 
         _refreshButton.setFont(ApplicationRegistry.getFont(Constants.FONT_BUTTON));
-        GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
+        GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
         gridData.widthHint = 80;
         _refreshButton.setLayoutData(gridData);
         _refreshButton.addSelectionListener(new SelectionAdapter()
@@ -429,12 +428,14 @@
         }
         
         Display display = Display.getCurrent();
-        Shell shell = ViewUtility.createPopupShell("Attribute", width, height);
+        Shell shell = ViewUtility.createPopupShell(Constants.ATTRIBUTE, width, height);
         createDetailsPopupContents(shell, data);
 
         shell.open();
-        while (!shell.isDisposed()) {
-            if (!display.readAndDispatch()) {
+        while (!shell.isDisposed())
+        {
+            if (!display.readAndDispatch())
+            {
                 display.sleep();
             }
         }
@@ -818,7 +819,8 @@
     private void animate(Canvas canvas, AttributeData data) throws Exception
     {
         String attribute = data.getName();
-        int value = MBeanUtility.refreshAttribute(_mbean, attribute);
+        Object valueObj = MBeanUtility.refreshAttribute(_mbean, attribute);
+        int value = Integer.parseInt(String.valueOf(valueObj));
         Object canvasData = canvas.getData(GRAPH_VALUES);
         long[] graphValues = (long[]) canvasData;
         

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java?view=diff&rev=492514&r1=492513&r2=492514
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java Thu Jan  4 02:52:06 2007
@@ -1,13 +1,17 @@
 package org.apache.qpid.management.ui.views;
 
-import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 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.ServerRegistry;
 import org.apache.qpid.management.ui.jmx.MBeanUtility;
+import org.apache.qpid.management.ui.model.AttributeData;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -24,6 +28,12 @@
 import org.eclipse.ui.forms.widgets.Form;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 
+/**
+ * Class to create widgets and control display for mbeantype(eg Connection, Queue, Exchange) selection
+ * on the navigation view.
+ * @author Bhupendra Bhardwaj
+ *
+ */
 public class MBeanTypeTabControl
 {
     private FormToolkit  _toolkit = null;
@@ -31,18 +41,26 @@
     private TabFolder _tabFolder = null;
     private Composite _composite = null;
     private Composite _listComposite = null;
+    private Composite _buttonsComposite = null;
     private Label _labelName = null;
     private Label _labelDesc = null;
     private Label _labelList = null;
+    
     private org.eclipse.swt.widgets.List _list = null;
     private Button _refreshButton = null;
     private Button _addButton = null;
+    private Button _sortBySizeButton = null;
     
     private String _type = null;
     
-    // maps an mbena name with the mbean object. Required to get mbean object when an mbean
+    // maps an mbean name with the mbean object. Required to get mbean object when an mbean
     // is to be added to the navigation view. 
     private HashMap<String, ManagedBean> _objectsMap = new HashMap<String, ManagedBean>();
+    // Map required for sorting queues based on attribute values
+    private Map<AttributeData, ManagedBean> _queueMap = new LinkedHashMap<AttributeData, ManagedBean>();
+    
+    private Sorter _sorterByName = new Sorter();
+    private ComparatorImpl _sorterByQueueDepth = new ComparatorImpl();
     
     public MBeanTypeTabControl(TabFolder tabFolder)
     {
@@ -58,6 +76,9 @@
         return _form;
     }
     
+    /**
+     * Adds listeners to all the buttons
+     */
     private void addListeners()
     {
         _addButton.addSelectionListener(new SelectionAdapter(){
@@ -69,7 +90,13 @@
                 String[] selectedItems = _list.getSelection();
                 for (int i = 0; i < selectedItems.length; i++)
                 {
-                    String name = selectedItems[i];
+                    String name = selectedItems[i];;
+                    if (Constants.QUEUE.equals(_type))
+                    {
+                        int endIndex = name.lastIndexOf("(");
+                        name = name.substring(0, endIndex -1);
+                    }
+                    // pass the ManagedBean to the navigation view to be added
                     ManagedBean mbean = _objectsMap.get(name);
                     IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); 
                     NavigationView view = (NavigationView)window.getActivePage().findView(NavigationView.ID);
@@ -98,6 +125,20 @@
                 }
             }
         });
+        
+        _sortBySizeButton.addSelectionListener(new SelectionAdapter(){
+            public void widgetSelected(SelectionEvent e)
+            {
+                try
+                {
+                    sortQueueByQueueDepth();
+                }
+                catch (Exception ex)
+                {
+                    MBeanUtility.handleException(ex);
+                }
+            }
+        });
     }
     
     private void createWidgets()
@@ -119,20 +160,22 @@
         _labelDesc.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false, 2, 1));
         _labelDesc.setFont(ApplicationRegistry.getFont(Constants.FONT_ITALIC));
         
-        _refreshButton = _toolkit.createButton(_composite, Constants.BUTTON_REFRESH, SWT.PUSH);
-        gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1);
-        gridData.widthHint = 80;
-        _refreshButton.setLayoutData(gridData);
-        
         _addButton = _toolkit.createButton(_composite, "<- Add to Navigation", SWT.PUSH);
         gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false);
         _addButton.setLayoutData(gridData);
         
+        _refreshButton = _toolkit.createButton(_composite, Constants.BUTTON_REFRESH, SWT.PUSH);
+        gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false);
+        gridData.widthHint = 80;
+        _refreshButton.setLayoutData(gridData);
+        
         // Composite to contain the item list 
         _listComposite = _toolkit.createComposite(_composite);
         gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
         _listComposite.setLayoutData(gridData);
-        _listComposite.setLayout(new GridLayout());
+        layout = new GridLayout();
+        layout.verticalSpacing = 0;
+        _listComposite.setLayout(layout);
         
         // Label for item name
         _labelList = _toolkit.createLabel(_listComposite, " ", SWT.NONE);
@@ -142,6 +185,18 @@
         _list = new List(_listComposite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
         gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
         _list.setLayoutData(gridData);
+        
+        
+        // Composite to contain buttons like - Sort by size
+        _buttonsComposite = _toolkit.createComposite(_composite);
+        gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+        _buttonsComposite.setLayoutData(gridData);
+        _buttonsComposite.setLayout(new GridLayout());
+        
+        _sortBySizeButton = _toolkit.createButton(_buttonsComposite, "Sort by Queue Depth", SWT.PUSH);
+        gridData = new GridData(SWT.CENTER, SWT.CENTER, true, false);
+        _sortBySizeButton.setLayoutData(gridData);
+        
     }
     
     public void refresh(String typeName) throws Exception
@@ -170,6 +225,7 @@
     {
         // map should be cleared before populating it with new values
         _objectsMap.clear();
+        _queueMap.clear();
         ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
         String[] items = null;
         java.util.List<ManagedBean> list = null;
@@ -178,27 +234,33 @@
         if (_type.equals(Constants.QUEUE))
         {
             list = serverRegistry.getQueues();
+            items = getQueueItems(list);
+            _sortBySizeButton.setVisible(true);
         }
         else if (_type.equals(Constants.EXCHANGE))
         {
-            list = serverRegistry.getExchanges();;
+            list = serverRegistry.getExchanges();
+            items = getItems(list);
+            _sortBySizeButton.setVisible(false);
         }
         else if (_type.equals(Constants.CONNECTION))
         {
             list = serverRegistry.getConnections();
+            items = getItems(list);
+            _sortBySizeButton.setVisible(false);
         }
         else
         {
             throw new Exception("Unknown mbean type " + _type);
         }
         
-        items = getItems(list);
         _list.setItems(items);
     }
     
     // sets the map with appropriate mbean and name
     private String[] getItems(java.util.List<ManagedBean> list)
     {
+        Collections.sort(list, _sorterByName);
         String[] items = new String[list.size()];
         int i = 0;
         for (ManagedBean mbean : list)
@@ -206,7 +268,60 @@
             items[i++] = mbean.getName();
             _objectsMap.put(mbean.getName(), mbean);
         }
-        Arrays.sort(items);
         return items;
+    }
+    
+    private String[] getQueueItems(java.util.List<ManagedBean> list) throws Exception
+    {
+        // 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);
+        String[] items = new String[list.size()];
+        int i = 0;
+        for (ManagedBean mbean : list)
+        {
+            AttributeData data = MBeanUtility.getAttributeData(mbean, Constants.ATTRIBUTE_QUEUE_DEPTH);
+            String value = data.getValue().toString();
+            items[i] = mbean.getName() + " (" + value + " KB)";
+            _objectsMap.put(mbean.getName(), mbean);
+            _queueMap.put(data, mbean);
+            i++;
+        }
+        return items;
+    }
+    
+    private void sortQueueByQueueDepth() throws Exception
+    {
+        // Queues are already in the alphabetically sorted order in _queueMap, now sort for queueDepth
+        java.util.List<AttributeData> list = new ArrayList<AttributeData>(_queueMap.keySet());
+        Collections.sort(list, _sorterByQueueDepth);
+        
+        String[] items = new String[list.size()];
+        int i = 0;
+        for (AttributeData data : list)
+        {
+            ManagedBean mbean = _queueMap.get(data);
+            String value = data.getValue().toString();
+            items[i++] = mbean.getName() + " (" + value + " KB)";
+        }
+        _list.setItems(items);
+    }
+    
+    private class ComparatorImpl implements java.util.Comparator<AttributeData>
+    {
+        public int compare(AttributeData data1, AttributeData data2)
+        {
+            Integer int1 = Integer.parseInt(data1.getValue().toString());
+            Integer int2 = Integer.parseInt(data2.getValue().toString());
+            return int1.compareTo(int2) * -1;
+        }
+    }
+    
+    private class Sorter implements java.util.Comparator<ManagedBean>
+    {
+        public int compare(ManagedBean mbean1, ManagedBean mbean2)
+        {
+            return mbean1.getName().compareTo(mbean2.getName());
+        }
     }
 }

Modified: incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java?view=diff&rev=492514&r1=492513&r2=492514
==============================================================================
--- incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java (original)
+++ incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java Thu Jan  4 02:52:06 2007
@@ -196,7 +196,7 @@
         formData = new FormData();
         formData.top = new FormAttachment(notificationNameCombo, 5);
         formData.left = new FormAttachment(fixedLabel, 10);
-        formData.right = new FormAttachment(80);
+        formData.right = new FormAttachment(100);
         descriptionLabel.setLayoutData(formData);
         descriptionLabel.setText("      ");
         descriptionLabel.setFont(ApplicationRegistry.getFont(Constants.FONT_ITALIC));