diff options
| author | Robert Gemmell <robbie@apache.org> | 2009-02-27 00:28:58 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2009-02-27 00:28:58 +0000 |
| commit | 291bad807ef9be1be58a11021e2e841f7da7f924 (patch) | |
| tree | 968c07bef11224df7f990443238d71feef2f0402 /qpid/java/management | |
| parent | 39472db877d012f997c8f96ed85e5479f755d0c6 (diff) | |
| download | qpid-python-291bad807ef9be1be58a11021e2e841f7da7f924.tar.gz | |
QPID-1697: for mbeans that are not queues, connections or exchanges, check the MBeanInfo can be retrieved before adding it to the navigation tree. Prevents showing the admin-only mbeans to users who cant view them anyway
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@748359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/management')
| -rw-r--r-- | qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java index 665fae2fe2..81cc5c6488 100644 --- a/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java +++ b/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java @@ -446,6 +446,21 @@ public class NavigationView extends ViewPart } } } + + //check if the MBeanInfo can be retrieved. + private boolean haveAccessPermission(ManagedBean mbean) + { + try + { + MBeanUtility.getMBeanInfo(mbean); + } + catch(Exception ex) + { + return false; + } + + return true; + } /** * Queries the Qpid Server and populates the given domain node with all MBeans undser that domain. @@ -469,7 +484,11 @@ public class NavigationView extends ViewPart // manually by selecting from MBeanView if (!(mbean.isConnection() || mbean.isExchange() || mbean.isQueue())) { - addManagedBean(domain, mbean); + //if we cant get the MBeanInfo then we cant display the mbean, so dont add it to the tree + if (haveAccessPermission(mbean)) + { + addManagedBean(domain, mbean); + } } } // To make it work with the broker without virtual host implementation. |
