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 | 537f7659947c161b6fd8ecd1b67a313ff1ab4411 (patch) | |
| tree | 8ff05f2121887496c6f7a8751774e48088da6b22 /java/management/eclipse-plugin | |
| parent | 0166adf6e744e3b383f439423c68ac32ab5577cd (diff) | |
| download | qpid-python-537f7659947c161b6fd8ecd1b67a313ff1ab4411.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/qpid@748359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/management/eclipse-plugin')
| -rw-r--r-- | 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/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java index 665fae2fe2..81cc5c6488 100644 --- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java +++ b/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. |
