don't throw excpetion if directory doesn't exist when removing

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@393051 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-04-10 20:39:00 +00:00
parent 3043e7ab31
commit daddd413a2
1 changed files with 20 additions and 21 deletions

View File

@ -211,28 +211,27 @@ public class RegionBroker implements Broker {
return answer;
}
public void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout) throws Exception {
if( !destinations.contains(destination) )
throw new JMSException("Destination does not exist: "+destination);
switch(destination.getDestinationType()) {
case ActiveMQDestination.QUEUE_TYPE:
queueRegion.removeDestination(context, destination, timeout);
break;
case ActiveMQDestination.TOPIC_TYPE:
topicRegion.removeDestination(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);
public void removeDestination(ConnectionContext context,ActiveMQDestination destination,long timeout)
throws Exception{
if(destinations.contains(destination)){
switch(destination.getDestinationType()){
case ActiveMQDestination.QUEUE_TYPE:
queueRegion.removeDestination(context,destination,timeout);
break;
case ActiveMQDestination.TOPIC_TYPE:
topicRegion.removeDestination(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);
}
destinations.remove(destination);
}
destinations.remove(destination);
}
public void addDestinationInfo(ConnectionContext context,DestinationInfo info) throws Exception{