if (log.isDebugEnabled()) {
log.debug("Removing consumer: " + info);
}
if (info.getDestination() != null && info.getDestination().isQueue()) {
synchronized (subscriptionMutex) {
Subscription sub = (Subscription) subscriptionContainer.removeSubscription(info.getConsumerId());
if (sub != null) {
sub.setActive(false);
sub.clear();//resets entries in the QueueMessageContainer
dispatcher.removeActiveSubscription(client, sub);
//need to do wildcards for this - but for now use exact matches
for (Iterator iter = messageContainers.values().iterator(); iter.hasNext();) {
QueueMessageContainer container = (QueueMessageContainer) iter.next();
//should change this for wild cards ...
if (container.getDestinationName().equals(sub.getDestination().getPhysicalName())) {
QueueList list = getSubscriptionList(container);
list.remove(sub);
if (list.isEmpty()) {
activeSubscriptions.remove(sub.getDestination().getPhysicalName());
}
list = getBrowserList(container);
list.remove(sub);
if (list.isEmpty()) {
browsers.remove(sub.getDestination().getPhysicalName());
}
}
}
}
}