From 4c408e494fa38aa27c65a1cb30bd7b61eb7a9ae5 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Thu, 25 Jan 2007 17:09:32 +0000 Subject: 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 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/perftesting@499855 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/server/queue/AMQQueueMBean.java | 38 ++++++++++++++-------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'qpid/java/broker/src/main') diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java index 1bdf265a1b..01678c357a 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java @@ -46,30 +46,42 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue 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 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue return new MBeanNotificationInfo[]{info1}; } -} // End of AMQMBean class +} // End of AMQQueueMBean class -- cgit v1.2.1