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/25 18:09:33 UTC

svn commit: r499855 - in /incubator/qpid/branches/perftesting/qpid/java: broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java

Author: ritchiem
Date: Thu Jan 25 09:09:32 2007
New Revision: 499855

URL: http://svn.apache.org/viewvc?view=rev&rev=499855
Log:
Revision: 496384
Author: bhupendrab
Date: 16:10:59, 15 January 2007
Message:
QPID-295
----
Modified : /incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
Modified : /incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java



Modified:
    incubator/qpid/branches/perftesting/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
    incubator/qpid/branches/perftesting/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java

Modified: incubator/qpid/branches/perftesting/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java?view=diff&rev=499855&r1=499854&r2=499855
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java Thu Jan 25 09:09:32 2007
@@ -46,30 +46,42 @@
     private AMQQueue _queue = null;
     private String _queueName = null;
     // OpenMBean data types for viewMessages method
-    private String[] _msgAttributeNames = {"Message Id", "Header", "Size(bytes)", "Redelivered"};
-    private String[] _msgAttributeIndex = {_msgAttributeNames[0]};
-    private OpenType[] _msgAttributeTypes = new OpenType[4]; // AMQ message attribute types.
-    private CompositeType _messageDataType = null;           // Composite type for representing AMQ Message data.
-    private TabularType _messagelistDataType = null;         // Datatype for representing AMQ messages list.
-
+    private final static String[] _msgAttributeNames = {"AMQ MessageId", "Header", "Size(bytes)", "Redelivered"};
+    private static String[] _msgAttributeIndex = {_msgAttributeNames[0]};
+    private static OpenType[] _msgAttributeTypes = new OpenType[4]; // AMQ message attribute types.
+    private static CompositeType _messageDataType = null;           // Composite type for representing AMQ Message data.
+    private static TabularType _messagelistDataType = null;         // Datatype for representing AMQ messages list.
+    
     // OpenMBean data types for viewMessageContent method
-    private CompositeType _msgContentType = null;
-    private String[] _msgContentAttributes = {"Message Id", "MimeType", "Encoding", "Content"};
-    private OpenType[] _msgContentAttributeTypes = new OpenType[4];
-
+    private static CompositeType _msgContentType = null;
+    private final static String[] _msgContentAttributes = {"AMQ MessageId", "MimeType", "Encoding", "Content"};
+    private static OpenType[] _msgContentAttributeTypes = new OpenType[4];
+    
     @MBeanConstructor("Creates an MBean exposing an AMQQueue")
     public AMQQueueMBean(AMQQueue queue) throws JMException
     {
         super(ManagedQueue.class, ManagedQueue.TYPE);
         _queue = queue;
         _queueName = jmxEncode(new StringBuffer(queue.getName()), 0).toString();
-        init();
+    }
+
+    static
+    {
+        try
+        {
+            init();
+        }
+        catch(JMException ex)
+        {
+            // It should never occur
+            System.out.println(ex.getMessage());
+        }
     }
 
     /**
      * initialises the openmbean data types
      */
-    private void init() throws OpenDataException
+    private static void init() throws OpenDataException
     {
         _msgContentAttributeTypes[0] = SimpleType.LONG;                    // For message id
         _msgContentAttributeTypes[1] = SimpleType.STRING;                  // For MimeType
@@ -347,4 +359,4 @@
         return new MBeanNotificationInfo[]{info1};
     }
 
-} // End of AMQMBean class
+} // End of AMQQueueMBean class

Modified: incubator/qpid/branches/perftesting/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java?view=diff&rev=499855&r1=499854&r2=499855
==============================================================================
--- incubator/qpid/branches/perftesting/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java (original)
+++ incubator/qpid/branches/perftesting/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java Thu Jan 25 09:09:32 2007
@@ -245,7 +245,7 @@
     }
 
     public void populatePropertiesFromBuffer(ByteBuffer buffer, int propertyFlags, int size)
-        throws AMQFrameDecodingException, AMQProtocolVersionException
+            throws AMQFrameDecodingException, AMQProtocolVersionException
     {
         _propertyFlags = propertyFlags;
 
@@ -619,6 +619,17 @@
 
     public String toString()
     {
-        return "reply-to = " + _replyTo + " propertyFlags = " + _propertyFlags;
+        return "reply-to = " + _replyTo +
+               ",propertyFlags = " + _propertyFlags +
+               ",ApplicationID = " + _appId +
+               ",ClusterID = " + _clusterId +
+               ",UserId = " + _userId +
+               ",JMSMessageID = " + _messageId +
+               ",JMSCorrelationID = " + _correlationId +
+               ",JMSDeliveryMode = " + _deliveryMode +
+               ",JMSExpiration = " + _expiration +
+               ",JMSPriority = " + _priority +
+               ",JMSTimestamp = " + _timestamp +
+               ",JMSType = " + _type;
     }
 }