You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2009/06/23 12:04:57 UTC
svn commit: r787620 - in /qpid/branches/jmx_mc_gsoc09/qpid/java:
broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
Author: robbie
Date: Tue Jun 23 10:04:57 2009
New Revision: 787620
URL: http://svn.apache.org/viewvc?rev=787620&view=rev
Log:
QPID-1932: expose Queue tabular/composite key values through the management interface
Modified:
qpid/branches/jmx_mc_gsoc09/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
qpid/branches/jmx_mc_gsoc09/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
Modified: qpid/branches/jmx_mc_gsoc09/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
URL: http://svn.apache.org/viewvc/qpid/branches/jmx_mc_gsoc09/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java?rev=787620&r1=787619&r2=787620&view=diff
==============================================================================
--- qpid/branches/jmx_mc_gsoc09/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java (original)
+++ qpid/branches/jmx_mc_gsoc09/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java Tue Jun 23 10:04:57 2009
@@ -81,15 +81,13 @@
private AMQQueue _queue = null;
private String _queueName = null;
// OpenMBean data types for viewMessages method
- private static final 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 static CompositeType _msgContentType = null;
- private static final String[] _msgContentAttributes = { "AMQ MessageId", "MimeType", "Encoding", "Content" };
private static OpenType[] _msgContentAttributeTypes = new OpenType[4];
private final long[] _lastNotificationTimes = new long[NotificationCheck.values().length];
@@ -133,18 +131,19 @@
_msgContentAttributeTypes[1] = SimpleType.STRING; // For MimeType
_msgContentAttributeTypes[2] = SimpleType.STRING; // For Encoding
_msgContentAttributeTypes[3] = new ArrayType(1, SimpleType.BYTE); // For message content
- _msgContentType =
- new CompositeType("Message Content", "AMQ Message Content", _msgContentAttributes, _msgContentAttributes,
- _msgContentAttributeTypes);
+ _msgContentType = new CompositeType("Message Content", "AMQ Message Content",
+ VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES, VIEW_MSG_CONTENT_COMPOSITE_ITEM_DESCRIPTIONS,
+ _msgContentAttributeTypes);
_msgAttributeTypes[0] = SimpleType.LONG; // For message id
_msgAttributeTypes[1] = new ArrayType(1, SimpleType.STRING); // For header attributes
_msgAttributeTypes[2] = SimpleType.LONG; // For size
_msgAttributeTypes[3] = SimpleType.BOOLEAN; // For redelivered
- _messageDataType =
- new CompositeType("Message", "AMQ Message", _msgAttributeNames, _msgAttributeNames, _msgAttributeTypes);
- _messagelistDataType = new TabularType("Messages", "List of messages", _messageDataType, _msgAttributeIndex);
+ _messageDataType = new CompositeType("Message", "AMQ Message", VIEW_MSGS_COMPOSITE_ITEM_NAMES,
+ VIEW_MSGS_COMPOSITE_ITEM_DESCRIPTIONS, _msgAttributeTypes);
+ _messagelistDataType = new TabularType("Messages", "List of messages", _messageDataType,
+ VIEW_MSGS_TABULAR_UNIQUE_INDEX);
}
public String getObjectInstanceName()
@@ -368,7 +367,7 @@
Object[] itemValues = { msgId, mimeType, encoding, msgContent.toArray(new Byte[0]) };
- return new CompositeDataSupport(_msgContentType, _msgContentAttributes, itemValues);
+ return new CompositeDataSupport(_msgContentType, VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES, itemValues);
}
catch (AMQException e)
{
@@ -402,7 +401,7 @@
// Create header attributes list
String[] headerAttributes = getMessageHeaderProperties(headerBody);
Object[] itemValues = { msg.getMessageId(), headerAttributes, headerBody.bodySize, msg.isRedelivered() };
- CompositeData messageData = new CompositeDataSupport(_messageDataType, _msgAttributeNames, itemValues);
+ CompositeData messageData = new CompositeDataSupport(_messageDataType, VIEW_MSGS_COMPOSITE_ITEM_NAMES, itemValues);
_messageList.put(messageData);
}
}
Modified: qpid/branches/jmx_mc_gsoc09/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/jmx_mc_gsoc09/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java?rev=787620&r1=787619&r2=787620&view=diff
==============================================================================
--- qpid/branches/jmx_mc_gsoc09/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java (original)
+++ qpid/branches/jmx_mc_gsoc09/qpid/java/management/common/src/main/java/org/apache/qpid/management/common/mbeans/ManagedQueue.java Tue Jun 23 10:04:57 2009
@@ -42,6 +42,18 @@
static final String TYPE = "Queue";
static final int VERSION = 2;
+ //TabularType and contained CompositeType key/description information for message list
+ //For compatibility reasons, DONT MODIFY the existing key values if expanding the set.
+ String[] VIEW_MSGS_COMPOSITE_ITEM_NAMES = {"AMQ MessageId", "Header", "Size(bytes)", "Redelivered"};
+ String[] VIEW_MSGS_COMPOSITE_ITEM_DESCRIPTIONS = {"AMQ MessageId", "Header", "Size(bytes)", "Redelivered"};
+ String[] VIEW_MSGS_TABULAR_UNIQUE_INDEX = {VIEW_MSGS_COMPOSITE_ITEM_NAMES[0]};
+
+ //CompositeType key/description information for message content
+ //For compatibility reasons, DONT MODIFY the existing key values if expanding the set.
+ String[] VIEW_MSG_CONTENT_COMPOSITE_ITEM_NAMES = { "AMQ MessageId", "MimeType", "Encoding", "Content" };
+ String[] VIEW_MSG_CONTENT_COMPOSITE_ITEM_DESCRIPTIONS = { "AMQ MessageId", "MimeType", "Encoding", "Content" };
+
+
/**
* Returns the Name of the ManagedQueue.
* @return the name of the managedQueue.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org