git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@812790 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2009-09-09 07:06:11 +00:00
parent 6fc3744c73
commit 390bb147ef
1 changed files with 6 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import org.apache.activemq.broker.jmx.BrokerView;
import org.apache.activemq.broker.jmx.BrokerViewMBean; import org.apache.activemq.broker.jmx.BrokerViewMBean;
import org.apache.activemq.broker.jmx.ManagedRegionBroker; import org.apache.activemq.broker.jmx.ManagedRegionBroker;
import org.apache.activemq.broker.jmx.ManagementContext; 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.broker.region.Queue;
import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQDestination;
@ -66,8 +67,11 @@ public class LocalBrokerFacade extends BrokerFacadeSupport {
public void purgeQueue(ActiveMQDestination destination) throws Exception { public void purgeQueue(ActiveMQDestination destination) throws Exception {
Set destinations = getManagedBroker().getQueueRegion().getDestinations(destination); Set destinations = getManagedBroker().getQueueRegion().getDestinations(destination);
for (Iterator i = destinations.iterator(); i.hasNext();) { for (Iterator i = destinations.iterator(); i.hasNext();) {
Queue regionQueue = (Queue)i.next(); Destination dest = (Destination) i.next();
regionQueue.purge(); if (dest instanceof Queue) {
Queue regionQueue = (Queue) dest;
regionQueue.purge();
}
} }
} }