Community
Participate
Working Groups
When I browse our jmx server using jconsole, all the objects are displayed in a flat list which is really not friendly. I would imagine that if jconsole has this problem, other consoles would have the same. I think it would be great to be able to preserve the relationships in the client whatever it is.
Created attachment 54892 [details] A hierarchical view of Equinox Contributions in jconsole A way to preserve relationships in jconsole is to play with the ObjectNames used to register the MBeans as specified in JMX best practices[1]. jconsole is "smart" enough to create a tree hierarchy based on the ObjectNames' properties[1] As a prototype, I tried to enrich the ObjectNames used to registered the various ContributionProxyMBean children. E.g. for a BundleContibution, I registered it under the ObjectName "jmxserver:Type=Bundle,name=" + bundle.getSymbolicName(); I attached a screenshot to show you the display on jconsole [1] http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/best-practices.jsp#mozTocId366979 [2] http://blogs.sun.com/lmalventosa/entry/jconsole_mbeans_tab_mbean_tree
Cool. can you attach a patch for this? By all means, point out any other best practice failures that we have in here.
Created attachment 55600 [details] A patch to enrich Contribution's ObjectNames this patch is a proof of concept (not thoroughly tested) which shows how we can enrich the Contribution's ObjectName to create a hierarchy based on ObjectNames properties. It simply flagged Contribution.getObjectName() method as protected (instead of private) so that subclasses could chose their ObjectName. E.g the ExtensionContribution.getObjectName() will return: jmxserver:type=Extension,ExtensionPoint=<extension-point ID>,name=<extension ID>
Great, thanks! I have released the patch as is for now. We need to re-visit the use of ObjectNames soon...