activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject activemq git commit: AMQ-6175 - Web console needs to only obtain lists of MBeans that are not suppressed.
Date Thu, 18 Feb 2016 21:36:36 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.13.x ef295414b -> 9224f27ba


AMQ-6175 - Web console needs to only obtain lists of MBeans that are not suppressed.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/9224f27b
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/9224f27b
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/9224f27b

Branch: refs/heads/activemq-5.13.x
Commit: 9224f27ba3bdf8001dae5930e994f42125d70a1c
Parents: ef29541
Author: Jeff Genender <jgenender@savoirtech.com>
Authored: Thu Feb 18 14:36:06 2016 -0700
Committer: Jeff Genender <jgenender@savoirtech.com>
Committed: Thu Feb 18 14:36:06 2016 -0700

----------------------------------------------------------------------
 .../apache/activemq/broker/jmx/BrokerView.java  | 30 ++++----
 .../broker/jmx/ManagedRegionBroker.java         | 75 ++++++++++++++++++--
 .../activemq/broker/jmx/ManagementContext.java  |  2 +-
 3 files changed, 87 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/9224f27b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
index 98417b1..f494154 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
@@ -281,77 +281,77 @@ public class BrokerView implements BrokerViewMBean {
 
     @Override
     public ObjectName[] getTopics() {
-        return safeGetBroker().getTopics();
+        return safeGetBroker().getTopicsNonSuppressed();
     }
 
     @Override
     public ObjectName[] getQueues() {
-        return safeGetBroker().getQueues();
+        return safeGetBroker().getQueuesNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTemporaryTopics() {
-        return safeGetBroker().getTemporaryTopics();
+        return safeGetBroker().getTemporaryTopicsNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTemporaryQueues() {
-        return safeGetBroker().getTemporaryQueues();
+        return safeGetBroker().getTemporaryQueuesNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTopicSubscribers() {
-        return safeGetBroker().getTopicSubscribers();
+        return safeGetBroker().getTopicSubscribersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getDurableTopicSubscribers() {
-        return safeGetBroker().getDurableTopicSubscribers();
+        return safeGetBroker().getDurableTopicSubscribersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getQueueSubscribers() {
-        return safeGetBroker().getQueueSubscribers();
+        return safeGetBroker().getQueueSubscribersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTemporaryTopicSubscribers() {
-        return safeGetBroker().getTemporaryTopicSubscribers();
+        return safeGetBroker().getTemporaryTopicSubscribersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTemporaryQueueSubscribers() {
-        return safeGetBroker().getTemporaryQueueSubscribers();
+        return safeGetBroker().getTemporaryQueueSubscribersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getInactiveDurableTopicSubscribers() {
-        return safeGetBroker().getInactiveDurableTopicSubscribers();
+        return safeGetBroker().getInactiveDurableTopicSubscribersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTopicProducers() {
-        return safeGetBroker().getTopicProducers();
+        return safeGetBroker().getTopicProducersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getQueueProducers() {
-        return safeGetBroker().getQueueProducers();
+        return safeGetBroker().getQueueProducersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTemporaryTopicProducers() {
-        return safeGetBroker().getTemporaryTopicProducers();
+        return safeGetBroker().getTemporaryTopicProducersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getTemporaryQueueProducers() {
-        return safeGetBroker().getTemporaryQueueProducers();
+        return safeGetBroker().getTemporaryQueueProducersNonSuppressed();
     }
 
     @Override
     public ObjectName[] getDynamicDestinationProducers() {
-        return safeGetBroker().getDynamicDestinationProducers();
+        return safeGetBroker().getDynamicDestinationProducersNonSuppressed();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/activemq/blob/9224f27b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
index 601fd15..ddd1a17 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagedRegionBroker.java
@@ -17,11 +17,8 @@
 package org.apache.activemq.broker.jmx;
 
 import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import java.util.*;
 import java.util.Map.Entry;
-import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArraySet;
 import java.util.concurrent.ExecutorService;
@@ -607,81 +604,151 @@ public class ManagedRegionBroker extends RegionBroker {
         return destination;
     }
 
+    private ObjectName[] onlyNonSuppressed (Set<ObjectName> set){
+        List<ObjectName> nonSuppressed = new ArrayList<ObjectName>();
+        for(ObjectName key : set){
+            if (managementContext.isAllowedToRegister(key)){
+                nonSuppressed.add(key);
+            }
+        }
+        return nonSuppressed.toArray(new ObjectName[nonSuppressed.size()]);
+    }
+
     protected ObjectName[] getTopics() {
         Set<ObjectName> set = topics.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTopicsNonSuppressed() {
+        return onlyNonSuppressed(topics.keySet());
+    }
+
     protected ObjectName[] getQueues() {
         Set<ObjectName> set = queues.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getQueuesNonSuppressed() {
+        return onlyNonSuppressed(queues.keySet());
+    }
+
     protected ObjectName[] getTemporaryTopics() {
         Set<ObjectName> set = temporaryTopics.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTemporaryTopicsNonSuppressed() {
+        return onlyNonSuppressed(temporaryTopics.keySet());
+    }
+
     protected ObjectName[] getTemporaryQueues() {
         Set<ObjectName> set = temporaryQueues.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTemporaryQueuesNonSuppressed() {
+        return onlyNonSuppressed(temporaryQueues.keySet());
+    }
+
     protected ObjectName[] getTopicSubscribers() {
         Set<ObjectName> set = topicSubscribers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTopicSubscribersNonSuppressed() {
+        return onlyNonSuppressed(topicSubscribers.keySet());
+    }
+
     protected ObjectName[] getDurableTopicSubscribers() {
         Set<ObjectName> set = durableTopicSubscribers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getDurableTopicSubscribersNonSuppressed() {
+        return onlyNonSuppressed(durableTopicSubscribers.keySet());
+    }
+
     protected ObjectName[] getQueueSubscribers() {
         Set<ObjectName> set = queueSubscribers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getQueueSubscribersNonSuppressed() {
+        return onlyNonSuppressed(queueSubscribers.keySet());
+    }
+
     protected ObjectName[] getTemporaryTopicSubscribers() {
         Set<ObjectName> set = temporaryTopicSubscribers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTemporaryTopicSubscribersNonSuppressed() {
+        return onlyNonSuppressed(temporaryTopicSubscribers.keySet());
+    }
+
     protected ObjectName[] getTemporaryQueueSubscribers() {
         Set<ObjectName> set = temporaryQueueSubscribers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTemporaryQueueSubscribersNonSuppressed() {
+        return onlyNonSuppressed(temporaryQueueSubscribers.keySet());
+    }
+
     protected ObjectName[] getInactiveDurableTopicSubscribers() {
         Set<ObjectName> set = inactiveDurableTopicSubscribers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getInactiveDurableTopicSubscribersNonSuppressed() {
+        return onlyNonSuppressed(inactiveDurableTopicSubscribers.keySet());
+    }
+
     protected ObjectName[] getTopicProducers() {
         Set<ObjectName> set = topicProducers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTopicProducersNonSuppressed() {
+        return onlyNonSuppressed(topicProducers.keySet());
+    }
+
     protected ObjectName[] getQueueProducers() {
         Set<ObjectName> set = queueProducers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getQueueProducersNonSuppressed() {
+        return onlyNonSuppressed(queueProducers.keySet());
+    }
+
     protected ObjectName[] getTemporaryTopicProducers() {
         Set<ObjectName> set = temporaryTopicProducers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTemporaryTopicProducersNonSuppressed() {
+        return onlyNonSuppressed(temporaryTopicProducers.keySet());
+    }
+
     protected ObjectName[] getTemporaryQueueProducers() {
         Set<ObjectName> set = temporaryQueueProducers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getTemporaryQueueProducersNonSuppressed() {
+        return onlyNonSuppressed(temporaryQueueProducers.keySet());
+    }
+
     protected ObjectName[] getDynamicDestinationProducers() {
         Set<ObjectName> set = dynamicDestinationProducers.keySet();
         return set.toArray(new ObjectName[set.size()]);
     }
 
+    protected ObjectName[] getDynamicDestinationProducersNonSuppressed() {
+        return onlyNonSuppressed(dynamicDestinationProducers.keySet());
+    }
+
     public Broker getContextBroker() {
         return contextBroker;
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/9224f27b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
index 907c0e6..b83ec9b 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java
@@ -411,7 +411,7 @@ public class ManagementContext implements Service {
         return result;
     }
 
-    private boolean isAllowedToRegister(ObjectName name) {
+    protected boolean isAllowedToRegister(ObjectName name) {
         boolean result = true;
         if (suppressMBean != null && suppressMBeanList != null) {
             for (ObjectName attr : suppressMBeanList) {


Mime
View raw message