From 6590d4b3d0ab62e8731b6f557e46cab739d1ecb5 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Thu, 1 Dec 2011 12:48:51 +0000 Subject: [PATCH] remove duplicate code removing advisories, handled cleanly in advisory broker already, additional load on destination map. Only on remove dest opts through, so impact is mostly small. better all the same. may lead to reduction in acces modes for the destination map git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1209058 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/broker/region/RegionBroker.java | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java index f8f2b3123c..830ccf535d 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java @@ -30,7 +30,6 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.locks.ReentrantReadWriteLock; import javax.jms.InvalidClientIDException; import javax.jms.JMSException; -import org.apache.activemq.advisory.AdvisorySupport; import org.apache.activemq.broker.Broker; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.Connection; @@ -326,17 +325,13 @@ public class RegionBroker extends EmptyBroker { switch (destination.getDestinationType()) { case ActiveMQDestination.QUEUE_TYPE: queueRegion.removeDestination(context, destination, timeout); - removeAdvisoryTopics("Queue.", context, destination, timeout); break; case ActiveMQDestination.TOPIC_TYPE: topicRegion.removeDestination(context, destination, timeout); - removeAdvisoryTopics("Topic.", context, destination, timeout); break; case ActiveMQDestination.TEMP_QUEUE_TYPE: - tempQueueRegion.removeDestination(context, destination, timeout); break; case ActiveMQDestination.TEMP_TOPIC_TYPE: - tempTopicRegion.removeDestination(context, destination, timeout); break; default: throw createUnknownDestinationTypeException(destination); @@ -347,25 +342,6 @@ public class RegionBroker extends EmptyBroker { } - public void removeAdvisoryTopics(String destinationType, ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception { - if (this.brokerService.isAdvisorySupport()) { - String producerAdvisoryTopic = AdvisorySupport.PRODUCER_ADVISORY_TOPIC_PREFIX + destinationType + destination.getPhysicalName(); - String consumerAdvisoryTopic = AdvisorySupport.CONSUMER_ADVISORY_TOPIC_PREFIX + destinationType + destination.getPhysicalName(); - - ActiveMQDestination dests[] = getDestinations(); - for (ActiveMQDestination dest: dests) { - String name = dest.getPhysicalName(); - if ( name.equals(producerAdvisoryTopic) || name.equals(consumerAdvisoryTopic) ) { - try { - removeDestination(context, dest, timeout); - } catch (JMSException ignore) { - // at least ignore the Unknown Destination Type JMSException - } - } - } - } - } - @Override public void addDestinationInfo(ConnectionContext context, DestinationInfo info) throws Exception { addDestination(context, info.getDestination(),true);