summaryrefslogtreecommitdiff
path: root/qpid/java/broker
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-01-25 17:09:32 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-01-25 17:09:32 +0000
commit4c408e494fa38aa27c65a1cb30bd7b61eb7a9ae5 (patch)
tree4b7ee12e0448bb786128e28c9278b5635decb0bd /qpid/java/broker
parent3b38933380a6583004a8b19511a6e056114dd811 (diff)
downloadqpid-python-4c408e494fa38aa27c65a1cb30bd7b61eb7a9ae5.tar.gz
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
Diffstat (limited to 'qpid/java/broker')
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java38
1 files changed, 25 insertions, 13 deletions
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