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

svn commit: r496725 [6/11] - in /incubator/qpid/branches/perftesting/qpid: gentools/ gentools/src/org/apache/qpid/gentools/ gentools/templ.cpp/ gentools/templ.java/ java/ java/broker/ java/broker/etc/ java/broker/src/main/java/org/apache/qpid/server/ j...

Modified: incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java Tue Jan 16 07:16:39 2007
@@ -37,39 +37,23 @@
 
     private static final Logger _logger = Logger.getLogger(PropertyFieldTableTest.class);
 
-    /**
-     * Test that modifying a byte[] after setting property doesn't change property
-     */
-    public void testByteModification()
-    {
-        PropertyFieldTable table = new PropertyFieldTable();
-        byte[] bytes = {99, 98, 97, 96, 95};
-        table.setBytes("bytes", bytes);
-        bytes[0] = 1;
-        bytes[1] = 2;
-        bytes[2] = 3;
-        bytes[3] = 4;
-        bytes[4] = 5;
-
-        assertBytesNotEqual(bytes, table.getBytes("bytes"));
-    }
 
     /**
      * Test that setting a similar named value replaces any previous value set on that name
      */
     public void testReplacement()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         //Set a boolean value
         table1.setBoolean("value", true);
-        //Check size of table is correct (<Value length> + <type> + <Boolean length>)
+        //Check length of table is correct (<Value length> + <type> + <Boolean length>)
         int size = EncodingUtils.encodedShortStringLength("value") + 1 + EncodingUtils.encodedBooleanLength();
         Assert.assertEquals(size, table1.getEncodedSize());
 
         // reset value to an integer
         table1.setInteger("value", Integer.MAX_VALUE);
 
-        // Check the size has changed accordingly   (<Value length> + <type> + <Integer length>)
+        // Check the length has changed accordingly   (<Value length> + <type> + <Integer length>)
         size = EncodingUtils.encodedShortStringLength("value") + 1 + EncodingUtils.encodedIntegerLength();
         Assert.assertEquals(size, table1.getEncodedSize());
 
@@ -86,7 +70,7 @@
      */
     public void testBoolean()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setBoolean("value", true);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -107,19 +91,9 @@
         //except value as a string
         Assert.assertEquals("true", table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_BOOLEAN_PROPERTY_PREFIX, "value", null);
-
-        // Should be able to get the null back
-        Assert.assertEquals(null, table1.getBoolean("value"));
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
-
         table1.remove("value");
-        //but after a remove it doesn't
-        Assert.assertFalse(table1.containsKey("value"));
 
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -132,7 +106,7 @@
      */
     public void testByte()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setByte("value", Byte.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -151,20 +125,8 @@
         //... and a the string value of it.
         Assert.assertEquals("" + Byte.MAX_VALUE, table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_BYTE_PROPERTY_PREFIX, "value", null);
-
-        // Should be able to get the null back
-        Assert.assertEquals(null, table1.getByte("value"));
-
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
-
         table1.remove("value");
-        //but after a remove it doesn't
-        Assert.assertFalse(table1.containsKey("value"));
-
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -177,7 +139,7 @@
      */
     public void testShort()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setShort("value", Short.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -196,20 +158,8 @@
         //... and a the string value of it.
         Assert.assertEquals("" + Short.MAX_VALUE, table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_SHORT_PROPERTY_PREFIX, "value", null);
-
-        // Should be able to get the null back
-        Assert.assertEquals(null, table1.getShort("value"));
-
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
-
         table1.remove("value");
-        //but after a remove it doesn't
-        Assert.assertFalse(table1.containsKey("value"));
-
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -223,7 +173,7 @@
      */
     public void testChar()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setChar("value", 'c');
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -242,26 +192,9 @@
         //... and a the string value of it.
         Assert.assertEquals("c", table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_ASCII_CHARACTER_PROPERTY_PREFIX, "value", null);
-
-        try
-        {
-            table1.getString("value");
-            fail("Should throw NullPointerException");
-        }
-        catch (NullPointerException npe)
-        {
-            //Normal Path
-        }
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
-
         table1.remove("value");
-        //but after a remove it doesn't
-        Assert.assertFalse(table1.containsKey("value"));
 
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -275,7 +208,7 @@
      */
     public void testDouble()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setDouble("value", Double.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -293,20 +226,11 @@
 
         //... and a the string value of it.
         Assert.assertEquals("" + Double.MAX_VALUE, table1.getString("value"));
-
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_DOUBLE_PROPERTY_PREFIX, "value", null);
-
-        Assert.assertEquals(null, table1.getDouble("value"));
-
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
-
         table1.remove("value");
         //but after a remove it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -320,7 +244,7 @@
      */
     public void testFloat()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setFloat("value", Float.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -339,19 +263,12 @@
         //... and a the string value of it.
         Assert.assertEquals("" + Float.MAX_VALUE, table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_FLOAT_PROPERTY_PREFIX, "value", null);
-
-        Assert.assertEquals(null, table1.getFloat("value"));
-
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
 
         table1.remove("value");
         //but after a remove it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -365,7 +282,7 @@
      */
     public void testInt()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setInteger("value", Integer.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -384,19 +301,12 @@
         //... and a the string value of it.
         Assert.assertEquals("" + Integer.MAX_VALUE, table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_INT_PROPERTY_PREFIX, "value", null);
-
-        Assert.assertEquals(null, table1.getInteger("value"));
-
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
 
         table1.remove("value");
         //but after a remove it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -410,7 +320,7 @@
      */
     public void testLong()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setLong("value", Long.MAX_VALUE);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -429,19 +339,12 @@
         //... and a the string value of it.
         Assert.assertEquals("" + Long.MAX_VALUE, table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_LONG_PROPERTY_PREFIX, "value", null);
-
-        Assert.assertEquals(null, table1.getLong("value"));
-
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
 
         table1.remove("value");
         //but after a remove it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -457,7 +360,7 @@
     {
         byte[] bytes = {99, 98, 97, 96, 95};
 
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setBytes("value", bytes);
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -476,19 +379,11 @@
         //... and a the string value of it is null
         Assert.assertEquals(null, table1.getString("value"));
 
-        //Try setting a null value and read it back
-        table1.put(PropertyFieldTable.Prefix.AMQP_BINARY_PROPERTY_PREFIX, "value", null);
-
-        Assert.assertEquals(null, table1.getBytes("value"));
-
-        //but still contains the value
-        Assert.assertTrue(table1.containsKey("value"));
-
         table1.remove("value");
         //but after a remove it doesn't
         Assert.assertFalse(table1.containsKey("value"));
 
-        // Table should now have zero size for encoding
+        // Table should now have zero length for encoding
         checkEmpty(table1);
 
         //Looking up an invalid value returns null
@@ -499,19 +394,17 @@
      * Calls all methods that can be used to check the table is empty
      * - getEncodedSize
      * - isEmpty
-     * - size
+     * - length
      *
      * @param table to check is empty
      */
-    private void checkEmpty(PropertyFieldTable table)
+    private void checkEmpty(FieldTable table)
     {
         Assert.assertEquals(0, table.getEncodedSize());
         Assert.assertTrue(table.isEmpty());
         Assert.assertEquals(0, table.size());
 
         Assert.assertEquals(0, table.keySet().size());
-        Assert.assertEquals(0, table.values().size());
-        Assert.assertEquals(0, table.entrySet().size());
     }
 
 
@@ -521,7 +414,7 @@
      */
     public void testString()
     {
-        PropertyFieldTable table1 = new PropertyFieldTable();
+        FieldTable table1 = new FieldTable();
         table1.setString("value", "Hello");
         Assert.assertTrue(table1.propertyExists("value"));
 
@@ -562,79 +455,11 @@
     }
 
 
-    /**
-     * Test that the generated XML can be used to create a field table with the same values.
-     */
-    public void testValidXML()
-    {
-        PropertyFieldTable table1 = new PropertyFieldTable();
-        table1.setBoolean("bool", true);
-        table1.setByte("byte", Byte.MAX_VALUE);
-        byte[] bytes = {99, 98, 97, 96, 95};
-        table1.setBytes("bytes", bytes);
-        table1.setChar("char", 'c');
-        table1.setDouble("double", Double.MAX_VALUE);
-        table1.setFloat("float", Float.MAX_VALUE);
-        table1.setInteger("int", Integer.MAX_VALUE);
-        table1.setLong("long", Long.MAX_VALUE);
-        table1.setShort("short", Short.MAX_VALUE);
-        table1.setString("string", "Hello");
-        table1.setString("null-string", null);
-
-        table1.setObject("object-bool", true);
-        table1.setObject("object-byte", Byte.MAX_VALUE);
-        table1.setObject("object-bytes", bytes);
-        table1.setObject("object-char", 'c');
-        table1.setObject("object-double", Double.MAX_VALUE);
-        table1.setObject("object-float", Float.MAX_VALUE);
-        table1.setObject("object-int", Integer.MAX_VALUE);
-        table1.setObject("object-long", Long.MAX_VALUE);
-        table1.setObject("object-short", Short.MAX_VALUE);
-        table1.setObject("object-string", "Hello");
-
-        Assert.assertEquals(21, table1.size());
-
-        String table1XML = table1.toString();
-
-        PropertyFieldTable table2 = new PropertyFieldTable(table1XML);
-
-        Assert.assertEquals(table1XML, table2.toString());
-
-        //Check that when bytes is written out as a string with no new line between items that it is read in ok.
-
-    }
-
-    /**
-     * Test that invalid input throws the correct Exception
-     */
-    public void testInvalidXML()
-    {
-        try
-        {
-            _logger.warn("Testing Invalid XML expecting IllegalArgumentException");
-            new PropertyFieldTable("Rubbish");
-            fail("IllegalArgumentException expected");
-        }
-        catch (IllegalArgumentException iae)
-        {
-            //normal path
-        }
-        try
-        {
-            _logger.warn("Testing Invalid XML expecting IllegalArgumentException");
-            new PropertyFieldTable("");
-            fail("IllegalArgumentException expected");
-        }
-        catch (IllegalArgumentException iae)
-        {
-            //normal path
-        }
-    }
-
+    
 
     public void testKeyEnumeration()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
         table.setLong("one", 1L);
         table.setLong("two", 2L);
         table.setLong("three", 3L);
@@ -652,7 +477,7 @@
 
     public void testValues()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
         table.setBoolean("bool", true);
         table.setByte("byte", Byte.MAX_VALUE);
         byte[] bytes = {99, 98, 97, 96, 95};
@@ -707,7 +532,7 @@
     {
         byte[] bytes = {99, 98, 97, 96, 95};
 
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
         table.setBoolean("bool", true);
         table.setByte("byte", Byte.MAX_VALUE);
 
@@ -732,7 +557,7 @@
 
         try
         {
-            PropertyFieldTable table2 = new PropertyFieldTable(buffer, length);
+            FieldTable table2 = new FieldTable(buffer, length);
 
             Assert.assertEquals((Boolean) true, table2.getBoolean("bool"));
             Assert.assertEquals((Byte) Byte.MAX_VALUE, table2.getByte("byte"));
@@ -756,7 +581,7 @@
 
     public void testEncodingSize()
     {
-        PropertyFieldTable result = new PropertyFieldTable();
+        FieldTable result = new FieldTable();
         int size = 0;
 
         result.setBoolean("boolean", true);
@@ -847,31 +672,31 @@
 //    public void testEncodingSize1()
 //    {
 //                PropertyFieldTable table = new PropertyFieldTable();
-//        int size = 0;
+//        int length = 0;
 //        result.put("one", 1L);
-//        size = EncodingUtils.encodedShortStringLength("one");
-//        size += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(size, result.getEncodedSize());
+//        length = EncodingUtils.encodedShortStringLength("one");
+//        length += 1 + EncodingUtils.encodedLongLength();
+//        assertEquals(length, result.getEncodedSize());
 //
 //        result.put("two", 2L);
-//        size += EncodingUtils.encodedShortStringLength("two");
-//        size += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(size, result.getEncodedSize());
+//        length += EncodingUtils.encodedShortStringLength("two");
+//        length += 1 + EncodingUtils.encodedLongLength();
+//        assertEquals(length, result.getEncodedSize());
 //
 //        result.put("three", 3L);
-//        size += EncodingUtils.encodedShortStringLength("three");
-//        size += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(size, result.getEncodedSize());
+//        length += EncodingUtils.encodedShortStringLength("three");
+//        length += 1 + EncodingUtils.encodedLongLength();
+//        assertEquals(length, result.getEncodedSize());
 //
 //        result.put("four", 4L);
-//        size += EncodingUtils.encodedShortStringLength("four");
-//        size += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(size, result.getEncodedSize());
+//        length += EncodingUtils.encodedShortStringLength("four");
+//        length += 1 + EncodingUtils.encodedLongLength();
+//        assertEquals(length, result.getEncodedSize());
 //
 //        result.put("five", 5L);
-//        size += EncodingUtils.encodedShortStringLength("five");
-//        size += 1 + EncodingUtils.encodedLongLength();
-//        assertEquals(size, result.getEncodedSize());
+//        length += EncodingUtils.encodedShortStringLength("five");
+//        length += 1 + EncodingUtils.encodedLongLength();
+//        assertEquals(length, result.getEncodedSize());
 //
 //        //fixme should perhaps be expanded to incorporate all types.
 //
@@ -907,7 +732,7 @@
      */
     public void testSetObject()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         //Try setting a non primative object
 
@@ -920,7 +745,7 @@
         {
             //normal path
         }
-        // so size should be zero
+        // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
     }
 
@@ -929,7 +754,7 @@
      */
     public void testCheckPropertyNameasNull()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         try
         {
@@ -940,7 +765,7 @@
         {
             //normal path
         }
-        // so size should be zero
+        // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
     }
 
@@ -950,7 +775,7 @@
      */
     public void testCheckPropertyNameasEmptyString()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         try
         {
@@ -961,7 +786,7 @@
         {
             //normal path
         }
-        // so size should be zero
+        // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
     }
 
@@ -971,7 +796,7 @@
      */
     public void testCheckPropertyNamehasMaxLength()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         StringBuffer longPropertyName = new StringBuffer(129);
 
@@ -989,7 +814,7 @@
         {
             //normal path
         }
-        // so size should be zero
+        // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
     }
 
@@ -999,7 +824,7 @@
      */
     public void testCheckPropertyNameStartCharacterIsLetter()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         //Try a name that starts with a number
         try
@@ -1011,7 +836,7 @@
         {
             //normal path
         }
-        // so size should be zero
+        // so length should be zero
         Assert.assertEquals(0, table.getEncodedSize());
     }
 
@@ -1021,7 +846,7 @@
      */
     public void testCheckPropertyNameStartCharacterIsHashorDollar()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         //Try a name that starts with a number
         try
@@ -1041,12 +866,10 @@
      */
     public void testContents()
     {
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         table.put("StringProperty", "String");
 
-        Assert.assertTrue(table.containsValue("String"));
-
         Assert.assertEquals("String", table.get("StringProperty"));
 
         //Test Clear
@@ -1062,7 +885,7 @@
     public void testSets()
     {
 
-        PropertyFieldTable table = new PropertyFieldTable();
+        FieldTable table = new FieldTable();
 
         table.put("n1", "1");
         table.put("n2", "2");
@@ -1075,63 +898,9 @@
         Assert.assertFalse(iterator.hasNext());
 
 
-        iterator = table.values().iterator();
-        Assert.assertEquals("1", iterator.next());
-        Assert.assertEquals("2", iterator.next());
-        Assert.assertEquals("3", iterator.next());
-        Assert.assertFalse(iterator.hasNext());
-
-
-        iterator = table.entrySet().iterator();
-        Map.Entry entry = (Map.Entry) iterator.next();
-        Assert.assertEquals("n1", entry.getKey());
-        Assert.assertEquals("1", entry.getValue());
-        entry = (Map.Entry) iterator.next();
-        Assert.assertEquals("n2", entry.getKey());
-        Assert.assertEquals("2", entry.getValue());
-        entry = (Map.Entry) iterator.next();
-        Assert.assertEquals("n3", entry.getKey());
-        Assert.assertEquals("3", entry.getValue());
-        Assert.assertFalse(iterator.hasNext());
-
 
     }
 
-
-    /**
-     * Test that all the values are preserved after a putAll
-     */
-    public void testPutAll()
-    {
-        Map map = new HashMap();
-
-        map.put("char", 'c');
-        map.put("double", Double.MAX_VALUE);
-        map.put("float", Float.MAX_VALUE);
-        map.put("int", Integer.MAX_VALUE);
-        map.put("long", Long.MAX_VALUE);
-        map.put("short", Short.MAX_VALUE);
-
-        PropertyFieldTable table = new PropertyFieldTable();
-
-        table.putAll(map);
-
-        Assert.assertEquals(6, table.size());
-
-        Assert.assertTrue(table.containsKey("char"));
-        Assert.assertEquals('c', (char) table.getCharacter("char"));
-        Assert.assertTrue(table.containsKey("double"));
-        Assert.assertEquals(Double.MAX_VALUE, table.getDouble("double"));
-        Assert.assertTrue(table.containsKey("float"));
-        Assert.assertEquals(Float.MAX_VALUE, table.getFloat("float"));
-        Assert.assertTrue(table.containsKey("int"));
-        Assert.assertEquals(Integer.MAX_VALUE, (int) table.getInteger("int"));
-        Assert.assertTrue(table.containsKey("long"));
-        Assert.assertEquals(Long.MAX_VALUE, (long) table.getLong("long"));
-        Assert.assertTrue(table.containsKey("short"));
-        Assert.assertEquals(Short.MAX_VALUE, (short) table.getShort("short"));
-        Assert.assertEquals(Short.MAX_VALUE, (short) table.getShort("short"));
-    }
 
 
     private void assertBytesEqual(byte[] expected, byte[] actual)

Modified: incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java Tue Jan 16 07:16:39 2007
@@ -39,7 +39,7 @@
         //Create Pool
         _executorService = ReferenceCountingExecutorService.getInstance();
         _executorService.acquireExecutorService();
-        _pool = new PoolingFilter(_executorService, PoolingFilter.WRITE_EVENTS,
+        _pool = PoolingFilter.createAynschWritePoolingFilter(_executorService, 
                                   "AsynchronousWriteFilter");
 
     }

Modified: incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/bin.xml?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/bin.xml (original)
+++ incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/bin.xml Tue Jan 16 07:16:39 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>

Modified: incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/client-bin.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/client-bin.xml?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/client-bin.xml (original)
+++ incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/client-bin.xml Tue Jan 16 07:16:39 2007
@@ -43,6 +43,9 @@
           <outputDirectory>qpid-${qpid.version}</outputDirectory>
           <includes>
               <include>DISCLAIMER</include>
+              <include>LICENSE.txt</include>
+              <include>NOTICE.txt</include>
+              <include>README.txt</include>
           </includes>
       </fileSet>
       <fileSet>

Modified: incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/src.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/src.xml?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/src.xml (original)
+++ incubator/qpid/branches/perftesting/qpid/java/distribution/src/main/assembly/src.xml Tue Jan 16 07:16:39 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/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh Tue Jan 16 07:16:39 2007
@@ -1,3 +1,13 @@
 #!/bin/bash
 
+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
+
 "$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"

Modified: incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java Tue Jan 16 07:16:39 2007
@@ -34,9 +34,12 @@
     public final static String DOMAIN     = "domain";
     public final static String TYPE       = "mbeantype";
     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 ATTRIBUTE_QUEUE_DEPTH = "QueueDepth"; 
     
     public final static String ALL = "All";
     

Modified: incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java Tue Jan 16 07:16:39 2007
@@ -21,15 +21,23 @@
 package org.apache.qpid.management.ui;
 
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.qpid.management.ui.jmx.ClientListener;
+import org.apache.qpid.management.ui.model.ManagedAttributeModel;
 import org.apache.qpid.management.ui.model.NotificationObject;
 import org.apache.qpid.management.ui.model.OperationDataModel;
 
 public abstract class ServerRegistry
 {
     private ManagedServer _managedServer = null;
+    // list of all Connection mbeans
+    protected List<ManagedBean> _connections = new ArrayList<ManagedBean>();
+    // list of all exchange mbeans
+    protected List<ManagedBean> _exchanges = new ArrayList<ManagedBean>();
+    // list of all queue mbenas
+    protected List<ManagedBean> _queues = new ArrayList<ManagedBean>();
     
     public ServerRegistry()
     {
@@ -51,6 +59,64 @@
         _managedServer = server;
     }
     
+    protected void addConnectionMBean(ManagedBean mbean)
+    {
+        _connections.add(mbean);
+    }
+    
+    protected void addExchangeMBean(ManagedBean mbean)
+    {
+        _exchanges.add(mbean);
+    }
+    
+    protected void addQueueMBean(ManagedBean mbean)
+    {
+        _queues.add(mbean);
+    }
+    
+    protected void removeConnectionMBean(ManagedBean mbean)
+    {
+        _connections.remove(mbean);
+    }
+    
+    protected void removeExchangeMBean(ManagedBean mbean)
+    {
+        _exchanges.remove(mbean);
+    }
+    
+    protected void removeQueueMBean(ManagedBean mbean)
+    {
+        _queues.remove(mbean);
+    }
+    
+    public List<ManagedBean> getConnections()
+    {
+        return _connections;
+    }
+    
+    public List<ManagedBean> getExchanges()
+    {
+        return _exchanges;
+    }
+    
+    public List<ManagedBean> getQueues()
+    {
+        return _queues;
+    }
+    
+    public abstract void addManagedObject(ManagedBean key);
+    
+    public abstract List<ManagedBean> getMBeans();
+    
+    public abstract void removeManagedObject(ManagedBean mbean);
+   
+    public List<ManagedBean> getObjectsToBeRemoved()
+    {
+        return null;
+    }
+    
+    public abstract ManagedAttributeModel getAttributeModel(ManagedBean mbean);
+    
     public abstract Object getServerConnection();
     
     public abstract void closeServerConnection() throws Exception;
@@ -60,6 +126,8 @@
     public abstract String[] getQueueNames();
     
     public abstract String[] getExchangeNames();
+    
+    public abstract String[] getConnectionNames();
     
     public abstract List<NotificationObject> getNotifications(ManagedBean mbean);
     

Modified: incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java Tue Jan 16 07:16:39 2007
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.management.ui.actions;
 
+import org.apache.qpid.management.ui.jmx.MBeanUtility;
 import org.apache.qpid.management.ui.views.MBeanView;
 import org.apache.qpid.management.ui.views.NavigationView;
 import org.eclipse.jface.action.IAction;
@@ -27,6 +28,10 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 
+/**
+ * This action refreshes both the views -Navigation and MBeanView
+ * @author Bhupendra Bhardwaj
+ */
 public class Refresh implements IWorkbenchWindowActionDelegate
 {
     private IWorkbenchWindow _window;
@@ -71,7 +76,14 @@
             view.refresh();
             
             MBeanView mbeanview = (MBeanView)_window.getActivePage().findView(MBeanView.ID);
-            mbeanview.refreshMBeanView();
+            try
+            {
+                mbeanview.refreshMBeanView();
+            }
+            catch (Exception ex)
+            {
+                MBeanUtility.handleException(ex);
+            }
         }
     }
 }

Modified: incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java Tue Jan 16 07:16:39 2007
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import javax.management.ListenerNotFoundException;
 import javax.management.MBeanInfo;
 import javax.management.MBeanServerConnection;
 import javax.management.Notification;
@@ -50,21 +51,31 @@
     private JMXConnector _jmxc = null;
     private MBeanServerConnection _mbsc = null;
     
-    private List<ManagedBean> _mbeansToBeAdded   = new ArrayList<ManagedBean>();
+    // When an mbean gets removed from mbean server, then the notification listener
+    // will add that mbean in this list.
     private List<ManagedBean> _mbeansToBeRemoved = new ArrayList<ManagedBean>();
     
-    private List<String> _queues    = new ArrayList<String>();
-    private List<String> _exchanges = new ArrayList<String>();
-    
-    private HashMap<String, ManagedBean>   _mbeansMap    = new HashMap<String, ManagedBean>(); 
+    // Map containing all managed beans and ampped with unique mbean name
+    private HashMap<String, ManagedBean>   _mbeansMap    = new HashMap<String, ManagedBean>();
+    // Map containing MBeanInfo for all mbeans and mapped with unique mbean name 
     private HashMap<String, MBeanInfo>     _mbeanInfoMap = new HashMap<String, MBeanInfo>();
+    // Map containing attribute model for all mbeans and mapped with unique mbean name
     private HashMap<String, ManagedAttributeModel>    _attributeModelMap = new HashMap<String, ManagedAttributeModel>();
+    // Map containing operation model for all mbeans and mapped with unique mbean name
     private HashMap<String, OperationDataModel>       _operationModelMap = new HashMap<String, OperationDataModel>();
+    // Map containing NotificationInfo for all mbeans and mapped with unique mbean name
     private HashMap<String, List<NotificationInfoModel>> _notificationInfoMap = new HashMap<String, List<NotificationInfoModel>>();
+    // Map containing all notifications sent for all mbeans, which are registered for notification
     private HashMap<String, List<NotificationObject>> _notificationsMap  = new HashMap<String, List<NotificationObject>>();
+    // For mbeans which have subscribed for a notification type
+    // mbean unique name mapped with notification map. Notification map contains list of notification type
+    // mapped with notification name. Notification type list contains those notification types,
+    // which are subscribed for notification.
     private HashMap<String, HashMap<String, List<String>>> _subscribedNotificationMap = new HashMap<String, HashMap<String, List<String>>>();
     
+    // listener for registration or unregistratioj of mbeans on mbean server
     private ClientNotificationListener _notificationListener = null;
+    // listener for server connection. Receives notification if server connection goes down
     private ClientListener _clientListener = null;
     
     public JMXServerRegistry(ManagedServer server) throws Exception
@@ -93,16 +104,23 @@
      */
     public void closeServerConnection() throws Exception
     {
-        if (_jmxc != null)
-            _jmxc.removeConnectionNotificationListener(_clientListener);
-        
-        if (_mbsc != null)
-            _mbsc.removeNotificationListener(_serverObjectName, _clientListener);
-        
-        // remove mbean notification listeners
-        for (String mbeanName : _subscribedNotificationMap.keySet())
+        try
+        {
+            if (_jmxc != null)
+                _jmxc.removeConnectionNotificationListener(_clientListener);
+
+            if (_mbsc != null)
+                _mbsc.removeNotificationListener(_serverObjectName, _clientListener);
+
+            // remove mbean notification listeners
+            for (String mbeanName : _subscribedNotificationMap.keySet())
+            {
+                _mbsc.removeNotificationListener(new ObjectName(mbeanName), _notificationListener);
+            }
+        }
+        catch (ListenerNotFoundException ex)
         {
-            _mbsc.removeNotificationListener(new ObjectName(mbeanName), _notificationListener);
+            System.out.println(ex.toString());
         }
     }
     
@@ -111,22 +129,32 @@
         return _mbeansMap.get(uniqueName);
     }
     
-    public void addManagedObject(ManagedBean key)
+    public void addManagedObject(ManagedBean mbean)
     {
-        if (Constants.QUEUE.equals(key.getType()))
-            _queues.add(key.getName());
-        else if (Constants.EXCHANGE.equals(key.getType()))
-            _exchanges.add(key.getName());
+        if (Constants.QUEUE.equals(mbean.getType()) && !mbean.getName().startsWith("tmp_"))
+        {
+            addQueueMBean(mbean);
+        }
+        else if (Constants.EXCHANGE.equals(mbean.getType()))
+        {
+            addExchangeMBean(mbean);
+        }
+        else if (Constants.CONNECTION.equals(mbean.getType()))
+        {
+            addConnectionMBean(mbean);
+        }
         
-        _mbeansMap.put(key.getUniqueName(), key);
+        _mbeansMap.put(mbean.getUniqueName(), mbean);
     }
 
     public void removeManagedObject(ManagedBean mbean)
     {
         if (Constants.QUEUE.equals(mbean.getType()))
-            _queues.remove(mbean.getName());
+            removeQueueMBean(mbean);
         else if (Constants.EXCHANGE.equals(mbean.getType()))
-            _exchanges.remove(mbean.getName());
+            removeExchangeMBean(mbean);
+        else if (Constants.CONNECTION.equals(mbean.getType()))
+            removeConnectionMBean(mbean);
         
         _mbeansMap.remove(mbean.getUniqueName());
     }
@@ -140,6 +168,11 @@
         return _mbeanInfoMap.get(mbean.getUniqueName());
     }
     
+    public List<ManagedBean> getMBeans()
+    {
+        return new ArrayList<ManagedBean>(_mbeansMap.values());
+    }
+    
     public void setNotificationInfo(ManagedBean mbean, List<NotificationInfoModel>value)
     {
         _notificationInfoMap.put(mbean.getUniqueName(), value);
@@ -259,27 +292,15 @@
     public void registerManagedObject(ObjectName objName)
     {
         JMXManagedObject managedObject = new JMXManagedObject(objName);
+        
         managedObject.setServer(getManagedServer());
-        _mbeansToBeAdded.add(managedObject);
+        addManagedObject(managedObject);
     }
     
     public void unregisterManagedObject(ObjectName objName)
     {
-        JMXManagedObject managedObject = new JMXManagedObject(objName);
-        managedObject.setServer(getManagedServer());
-        _mbeansToBeRemoved.add(managedObject);
-    }
-    
-    public List<ManagedBean> getObjectsToBeAdded()
-    {
-        if (_mbeansToBeAdded.isEmpty())
-            return null;
-        else
-        {
-            List<ManagedBean> list = _mbeansToBeAdded;
-            _mbeansToBeAdded = new ArrayList<ManagedBean>();
-            return list;
-        }
+        ManagedBean mbean = _mbeansMap.get(objName.toString());
+        _mbeansToBeRemoved.add(mbean);
     }
 
     public List<ManagedBean> getObjectsToBeRemoved()
@@ -316,12 +337,35 @@
     
     public String[] getQueueNames()
     {
-        return _queues.toArray(new String[0]);
+        String[] queues = new String[_queues.size()];
+        int i = 0;
+        for (ManagedBean mbean : _queues)
+        {
+            queues[i++] = mbean.getName();
+        }
+        return queues;
     }
     
     public String[] getExchangeNames()
     {
-        return _exchanges.toArray(new String[0]);
+        String[] exchanges = new String[_exchanges.size()];
+        int i = 0;
+        for (ManagedBean mbean : _exchanges)
+        {
+            exchanges[i++] = mbean.getName();
+        }
+        return exchanges;
+    }
+    
+    public String[] getConnectionNames()
+    {
+        String[] connections = new String[_connections.size()];
+        int i = 0;
+        for (ManagedBean mbean : _connections)
+        {
+            connections[i++] = mbean.getName();
+        }
+        return connections;
     }
 
     public ClientNotificationListener getNotificationListener()

Modified: incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java Tue Jan 16 07:16:39 2007
@@ -22,8 +22,10 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import javax.management.Attribute;
 import javax.management.AttributeList;
@@ -35,6 +37,7 @@
 import javax.management.MBeanNotificationInfo;
 import javax.management.MBeanOperationInfo;
 import javax.management.MBeanServerConnection;
+import javax.management.ObjectInstance;
 import javax.management.ObjectName;
 import javax.management.ReflectionException;
 
@@ -140,30 +143,30 @@
     {
         if (mbean == null)
         {
-            ViewUtility.popupErrorMessage("Error", ex.getMessage());
+            ViewUtility.popupErrorMessage("Error", "Managed Object is null \n" + ex.toString());
         }
         else if (ex instanceof IOException)
         {
-            ViewUtility.popupErrorMessage(mbean.getName(), ex.getMessage());
+            ViewUtility.popupErrorMessage(mbean.getName(), "IO Error occured \n" + ex.toString());
         }
         else if (ex instanceof ReflectionException)
         {
-            ViewUtility.popupErrorMessage(mbean.getName(), ex.getMessage());
+            ViewUtility.popupErrorMessage(mbean.getName(), "Server has thrown error \n" + ex.toString());
         }
         else if (ex instanceof InstanceNotFoundException)
         {
-            ViewUtility.popupErrorMessage(mbean.getName(), ex.getMessage());
+            ViewUtility.popupErrorMessage(mbean.getName(), "Managed Object Not Found \n" + ex.toString());
         }
         else if (ex instanceof MBeanException)
         {
-            String cause = ((MBeanException)ex).getTargetException().getMessage();
+            String cause = ((MBeanException)ex).getTargetException().toString();
             if (cause == null)
-                cause = ex.getMessage();
+                cause = ex.toString();
             ViewUtility.popupInfoMessage(mbean.getName(), cause);
         }
         else if (ex instanceof JMException)
         {
-            ViewUtility.popupErrorMessage(mbean.getName(), ex.getMessage());
+            ViewUtility.popupErrorMessage(mbean.getName(), "Management Exception occured \n" + ex.toString());
         }
         else if (ex instanceof ManagementConsoleException)
         {
@@ -171,9 +174,9 @@
         }
         else 
         {
-            ViewUtility.popupError(mbean.getName(), "Error occured", ex);
+            ViewUtility.popupErrorMessage(mbean.getName(), ex.toString());
         }
-        //ex.printStackTrace();
+        ex.printStackTrace();
     }
     
     /**
@@ -204,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();
@@ -215,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;
     }
     
     /**
@@ -237,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];
@@ -311,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++)
@@ -322,7 +357,6 @@
             
             serverRegistry.setOperationModel(mbean, dataModel);
         }
-        
         return dataModel;
     }
     
@@ -333,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
@@ -351,8 +385,43 @@
         {
             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>();
+        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
+        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
+        ObjectName objName = new ObjectName(domain + ":*"); 
+        Set objectInstances = mbsc.queryMBeans(objName, null);
+
+        for (Iterator itr = objectInstances.iterator(); itr.hasNext();)
+        {
+            ObjectInstance instance = (ObjectInstance)itr.next();
+            ManagedBean obj = new JMXManagedObject(instance.getObjectName());
+            mbeans.add(obj);
+        }
+        
+        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);
+        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
+        String[] domains = mbsc.getDomains();
+        return Arrays.asList(domains);
     }
 }

Modified: incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java Tue Jan 16 07:16:39 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/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java Tue Jan 16 07:16:39 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();
             }
         }
@@ -520,7 +521,7 @@
                 Composite composite = new Composite(parent, SWT.BORDER);
                 composite.setLayout(new GridLayout());
                 composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-                ViewUtility.createTabularDataHolder(composite,(TabularDataSupport)attribute.getValue());
+                ViewUtility.createTabularDataHolder(_toolkit, composite,(TabularDataSupport)attribute.getValue());
             }
             else
             {
@@ -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/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java?view=diff&rev=496725&r1=496724&r2=496725
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java Tue Jan 16 07:16:39 2007
@@ -25,8 +25,9 @@
 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.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.apache.qpid.management.ui.model.AttributeData;
 import org.apache.qpid.management.ui.model.OperationData;
@@ -38,7 +39,6 @@
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.TabFolder;
@@ -49,14 +49,22 @@
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.part.ViewPart;
 
-
+/**
+ * MBean View create appropriate view based on the user selection on the Navigation View.
+ * Create TabFolder for all MBeans and displays the attribtues and method tabs.
+ * @author Bhupendra Bhardwaj
+ *
+ */
 public class MBeanView extends ViewPart
 {
     public static final String ID = "org.apache.qpid.management.ui.mbeanView";
     
     private FormToolkit  _toolkit = null;
     private Form _form = null;
+    private static ManagedServer _server = null;
+    private TreeObject _selectedNode = null;
     private ManagedBean _mbean = 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();
    
@@ -64,7 +72,8 @@
     private static final String OPERATIONS_CONTROL = "OperationsTabControl";
     private static final String NOTIFICATIONS_CONTROL = "NotificationsTabControl";
     
-    
+    // TabFolder to list all the mbeans for a given mbeantype(eg Connection, Queue, Exchange)
+    private TabFolder typeTabFolder = null;
     /*
      * Listener for the selection events in the navigation view
      */ 
@@ -76,37 +85,89 @@
                 return;
 
             IStructuredSelection ss = (IStructuredSelection) sel;
-            TreeObject node = (TreeObject)ss.getFirstElement();
-            showSelectedMBean(node);
+            _selectedNode = (TreeObject)ss.getFirstElement();
+            
+            
+            // mbean should be set to null. A selection done on the navigation view can be either an mbean or
+            // an mbeantype. For mbeantype selection(eg Connection, Queue, Exchange) _mbean will remain null.
+            _mbean = null;
+            setInvisible();
+            _form.setText(Constants.APPLICATION_NAME);
+            
+            // If a selected node(mbean) gets unregistered from mbena server, mbenaview should should 
+            // make the tabfolber for that mbean invisible
+            if (_selectedNode == null)            
+                return;
+            
+            setServer();
+            try
+            {
+                if (Constants.TYPE.equals(_selectedNode.getType()))
+                {
+                    refreshTypeTabFolder(_selectedNode.getName());
+                }
+                else if (Constants.DOMAIN.equals(_selectedNode.getType()))
+                {
+                    refreshTypeTabFolder(typeTabFolder.getItem(0));
+                }
+                else
+                {
+                    showSelectedMBean();
+                }
+                _form.layout();
+            }
+            catch(Exception ex)
+            {
+                MBeanUtility.handleException(_mbean, ex);
+            }
         }
     }
 
-    public void showSelectedMBean(TreeObject node)
+    /**
+     * Sets the managedServer based on the selection in the navigation view
+     * At any given time MBeanView will be displaying information for an mbean of mbeantype
+     * for a specifiv managed server. This server information will be used by the tab controllers
+     * to get server registry.
+     */
+    private void setServer()
     {
-        _mbean = null;
-        setInvisible();
-        
-        if (node == null)
+        if (Constants.SERVER.equals(_selectedNode.getType()))
         {
-            _form.setText(Constants.APPLICATION_NAME);
-            return;
+            _server = (ManagedServer)_selectedNode.getManagedObject();
         }
-        
-        if (Constants.NOTIFICATION.equals(node.getType()))
+        else
+        {
+            TreeObject parent = _selectedNode.getParent();
+            while (parent != null && !parent.getType().equals(Constants.SERVER))
+            {
+                parent = parent.getParent();
+            }
+            
+            if (parent != null && parent.getType().equals(Constants.SERVER))
+                _server = (ManagedServer)parent.getManagedObject();
+        }
+    }
+    
+    public static ManagedServer getServer()
+    {
+        return _server;
+    }
+    
+    private void showSelectedMBean() throws Exception
+    {     
+        if (Constants.NOTIFICATION.equals(_selectedNode.getType()))
         {
-            _mbean = (ManagedBean)node.getParent().getManagedObject();                
+            _mbean = (ManagedBean)_selectedNode.getParent().getManagedObject();                
         }
-        else if (Constants.MBEAN.equals(node.getType()))
+        else if (Constants.MBEAN.equals(_selectedNode.getType()))
         {
-            _mbean = (ManagedBean)node.getManagedObject();                
+            _mbean = (ManagedBean)_selectedNode.getManagedObject();                
         }
         else
         {
-            _form.setText(Constants.APPLICATION_NAME);
             return;
         }
         
-        setFocus();
         try
         {                
             MBeanUtility.getMBeanInfo(_mbean);     
@@ -130,20 +191,17 @@
         }
         _form.setText(text);
         int tabIndex = 0;
-        if (Constants.NOTIFICATION.equals(node.getType()))
+        if (Constants.NOTIFICATION.equals(_selectedNode.getType()))
         {
             tabIndex = tabFolder.getItemCount() -1;
         }
        
         TabItem tab = tabFolder.getItem(tabIndex);
-        // refreshTab(tab);
         // If folder is being set as visible after tab refresh, then the tab 
-        // doesn't have the focus.
-                   
+        // doesn't have the focus.                  
         tabFolder.setSelection(tabIndex);
         refreshTab(tab);
         setVisible(tabFolder); 
-        _form.layout();
     }
     
     public void createPartControl(Composite parent)
@@ -156,23 +214,38 @@
         
         // Add selection listener for selection events in the Navigation view
         getSite().getPage().addSelectionListener(NavigationView.ID, selectionListener); 
+        
+        // Add mbeantype TabFolder. This will list all the mbeans under a mbeantype (eg Queue, Exchange).
+        // Using this list mbeans will be added in the navigation view
+        createTypeTabFolder();
     }
     
-    public void refreshMBeanView()
+    public void refreshMBeanView() throws Exception
     {
+        int tabIndex = 0;
+        TabItem tab = null;
         if (_mbean == null)
-            return;
-        
-        TabFolder tabFolder = tabFolderMap.get(_mbean.getType());
-        if (tabFolder == null)
-            return;
-        
-        int index = tabFolder.getSelectionIndex();
-        TabItem tab = tabFolder.getItem(index);
-        if (tab == null)
-            return;
-                
-        refreshTab(tab);
+        {
+            tabIndex = typeTabFolder.getSelectionIndex();
+            if (tabIndex == -1)
+                return;
+
+            tab = typeTabFolder.getItem(tabIndex);
+            refreshTypeTabFolder(tab);
+        }
+        else
+        {
+            TabFolder tabFolder = tabFolderMap.get(_mbean.getType());
+            if (tabFolder == null)
+                return;
+
+            tabIndex = tabFolder.getSelectionIndex();
+            tab = tabFolder.getItem(tabIndex);
+            if (tab == null)
+                return;
+
+            refreshTab(tab);
+        }
         _form.layout();
     }
     
@@ -185,7 +258,6 @@
         layoutData.right = new FormAttachment(100);
         layoutData.bottom = new FormAttachment(100);
         tabFolder.setLayoutData(layoutData);
-        tabFolder.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
         tabFolder.setVisible(false);
         
         createAttributesTab(tabFolder);
@@ -201,7 +273,7 @@
             }
         });
         
-        tabFolderMap.put(_mbean.getType(), tabFolder);               
+        tabFolderMap.put(_mbean.getType(), tabFolder);
         return tabFolder;
     }
     
@@ -209,7 +281,7 @@
     {
         // We can avoid refreshing the attributes tab because it's control
         // already contains the required values. But it is added for now and 
-        // will remove if there is any perfornce or any such issue.
+        // will remove if there is any performance issue or any other issue.
         // The operations control should be refreshed because there is only one
         // controller for all operations tab.
         // The Notifications control needs to refresh with latest set of notifications
@@ -218,6 +290,7 @@
             return;
         
         TabFolder tabFolder = tab.getParent();
+        // If an operation tab is selected, the operation data is attached with the tab
         if (tab.getData() != null && (tab.getData() instanceof OperationData))
         {           
             // Refresh selected operation tab
@@ -259,7 +332,7 @@
     
     private void createAttributesTab(TabFolder tabFolder)
     {
-        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(_mbean);
+        ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
         if (serverRegistry.getAttributeModel(_mbean).getCount() == 0)
         {
             return;
@@ -269,12 +342,12 @@
         tab.setText(Constants.ATTRIBUTES);
         AttributesTabControl control = new AttributesTabControl(tabFolder);
         tab.setControl(control.getControl());
-        tabFolder.setData(ATTRIBUTES_CONTROL, control);      
+        tabFolder.setData(ATTRIBUTES_CONTROL, control);
     }
     
     private void createOperationTabs(TabFolder tabFolder)
     {
-        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(_mbean);        
+        ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);        
         int operationsCount = serverRegistry.getOperationModel(_mbean).getCount();
         if (operationsCount == 0)
         {
@@ -314,7 +387,7 @@
            throw new InfoRequiredException("Please select the managed object and then attribute to be edited");
        
        String name = (_mbean.getName() != null) ? _mbean.getName() : _mbean.getType();
-       JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(_mbean);
+       ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
        if (serverRegistry.getAttributeModel(_mbean).getCount() == 0)
        {
            throw new InfoRequiredException("There are no attributes to be edited for " + name);
@@ -336,6 +409,85 @@
        tabControl.createDetailsPopup(attribute);
     }
     
+    /**
+     * Creates TabFolder and tabs for each mbeantype (eg Connection, Queue, Exchange)
+     */
+    private void createTypeTabFolder()
+    {
+        typeTabFolder = new TabFolder(_form.getBody(), SWT.NONE);
+        FormData layoutData = new FormData();
+        layoutData.left = new FormAttachment(0);
+        layoutData.top = new FormAttachment(0);
+        layoutData.right = new FormAttachment(100);
+        layoutData.bottom = new FormAttachment(100);
+        typeTabFolder.setLayoutData(layoutData);
+        typeTabFolder.setVisible(false);
+        
+        MBeanTypeTabControl controller = new MBeanTypeTabControl(typeTabFolder);
+        typeTabFolder.setData("CONTROLLER", controller);
+        
+        TabItem tab = new TabItem(typeTabFolder, SWT.NONE);
+        tab.setText(Constants.CONNECTION);       
+        tab.setControl(controller.getControl());
+        
+        tab = new TabItem(typeTabFolder, SWT.NONE);
+        tab.setText(Constants.EXCHANGE);       
+        tab.setControl(controller.getControl());
+        
+        tab = new TabItem(typeTabFolder, SWT.NONE);
+        tab.setText(Constants.QUEUE);       
+        tab.setControl(controller.getControl());
+        
+        typeTabFolder.addListener(SWT.Selection, new Listener()
+        {
+            public void handleEvent(Event evt)
+            {
+                TabItem tab = (TabItem)evt.item;     
+                try
+                {
+                    refreshTypeTabFolder(tab);
+                }
+                catch (Exception ex)
+                {
+                    MBeanUtility.handleException(ex);
+                }
+            }
+        });
+    }
+    
+    /**
+     * Refreshes the Selected mbeantype tab. The control lists all the available mbeans
+     * for an mbeantype(eg Queue, Exchange etc)
+     * @param tab
+     * @throws Exception
+     */
+    private void refreshTypeTabFolder(TabItem tab) throws Exception
+    {
+        if (tab == null)
+        {
+            return;
+        }
+        typeTabFolder.setSelection(tab);
+        MBeanTypeTabControl controller = (MBeanTypeTabControl)typeTabFolder.getData("CONTROLLER");
+        controller.refresh(tab.getText());
+        typeTabFolder.setVisible(true);
+    }
+    
+    private void refreshTypeTabFolder(String type) throws Exception
+    {
+        if (Constants.CONNECTION.equals(type))
+        {
+            refreshTypeTabFolder(typeTabFolder.getItem(0));
+        }
+        else if (Constants.EXCHANGE.equals(type))
+        {
+            refreshTypeTabFolder(typeTabFolder.getItem(1));
+        }
+        else if (Constants.QUEUE.equals(type))
+        {
+            refreshTypeTabFolder(typeTabFolder.getItem(2));
+        }
+    }
     
     /**
      * hides other folders and makes the given one visible.
@@ -357,6 +509,11 @@
         for (TabFolder folder : tabFolderMap.values())
         {
             folder.setVisible(false);
+        }
+        
+        if (typeTabFolder != null)
+        {
+            typeTabFolder.setVisible(false);
         }
     }