From 390bb147efcf8a6684f1865154846b0e3386da76 Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Wed, 9 Sep 2009 07:06:11 +0000 Subject: [PATCH] fix for https://issues.apache.org/activemq/browse/AMQ-1803 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@812790 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/activemq/web/LocalBrokerFacade.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/activemq-web/src/main/java/org/apache/activemq/web/LocalBrokerFacade.java b/activemq-web/src/main/java/org/apache/activemq/web/LocalBrokerFacade.java index 7ab725535d..4f8a1c3e1f 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/LocalBrokerFacade.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/LocalBrokerFacade.java @@ -25,6 +25,7 @@ import org.apache.activemq.broker.jmx.BrokerView; import org.apache.activemq.broker.jmx.BrokerViewMBean; import org.apache.activemq.broker.jmx.ManagedRegionBroker; import org.apache.activemq.broker.jmx.ManagementContext; +import org.apache.activemq.broker.region.Destination; import org.apache.activemq.broker.region.Queue; import org.apache.activemq.command.ActiveMQDestination; @@ -66,8 +67,11 @@ public class LocalBrokerFacade extends BrokerFacadeSupport { public void purgeQueue(ActiveMQDestination destination) throws Exception { Set destinations = getManagedBroker().getQueueRegion().getDestinations(destination); for (Iterator i = destinations.iterator(); i.hasNext();) { - Queue regionQueue = (Queue)i.next(); - regionQueue.purge(); + Destination dest = (Destination) i.next(); + if (dest instanceof Queue) { + Queue regionQueue = (Queue) dest; + regionQueue.purge(); + } } }