mirror of https://github.com/apache/activemq.git
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
This commit is contained in:
parent
3b7507f6b7
commit
6590d4b3d0
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue