From 409f1c667a0eb41ebaefb8c072565e23641152dd Mon Sep 17 00:00:00 2001 From: Bhupendra Bhusman Bhardwaj Date: Fri, 2 Mar 2007 13:26:51 +0000 Subject: QPID-390 Added test case for all the AMQQueue alerts git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/perftesting@513748 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/server/queue/AMQQueueMBean.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'qpid/java/broker') 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 9657fcfcb3..b3c682c771 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 @@ -60,6 +60,8 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue, Que private final long[] _lastNotificationTimes = new long[NotificationCheck.values().length]; + private Notification _lastNotification = null; + @MBeanConstructor("Creates an MBean exposing an AMQQueue") public AMQQueueMBean(AMQQueue queue) throws JMException { @@ -227,11 +229,16 @@ public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue, Que { // important : add log to the log file - monitoring tools may be looking for this _logger.info(notification.name() + " On Queue " + queue.getName() + " - " + notificationMsg); - - Notification n = new Notification(MonitorNotification.THRESHOLD_VALUE_EXCEEDED, this, + notificationMsg = notification.name() + " " + notificationMsg; + _lastNotification = new Notification(MonitorNotification.THRESHOLD_VALUE_EXCEEDED, this, ++_notificationSequenceNumber, System.currentTimeMillis(), notificationMsg); - _broadcaster.sendNotification(n); + _broadcaster.sendNotification(_lastNotification); + } + + public Notification getLastNotification() + { + return _lastNotification; } /** @see org.apache.qpid.server.queue.AMQQueue#deleteMessageFromTop() */ -- cgit v1.2.1