Added isEmpty() on DestinationMap

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1516803 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2013-08-23 10:12:25 +00:00
parent a52c014648
commit eb99e05d3a
2 changed files with 8 additions and 0 deletions

View File

@ -232,6 +232,10 @@ public class DestinationMap {
tempTopicRootNode = new DestinationMapNode(null);
}
public boolean isEmpty(){
return queueRootNode.isEmpty() && topicRootNode.isEmpty() && tempQueueRootNode.isEmpty() && tempTopicRootNode.isEmpty();
}
public static Set union(Set existing, Set candidates) {
if ( candidates != null ) {
if (existing != null) {

View File

@ -239,6 +239,10 @@ public class DestinationMapNode implements DestinationNode {
return path;
}
public boolean isEmpty(){
return childNodes.isEmpty();
}
protected void pruneIfEmpty() {
if (parent != null && childNodes.isEmpty() && values.isEmpty()) {
parent.removeChild(this);