JConsole Plugins with MBeans, java 1.6
Hi I'm trying to figure out how to add some custom mbeans from my application into a custom plugin tab.
I have a plugin tab created already, and i have some mbeans in the mbean tab.. but i'd like to be able to get them to this custom tab.
Any advice would be much appreciated.
Message was edited by:
Matimus
[342 byte] By [
Matimusa] at [2007-11-27 3:37:09]

# 1
Hi Matimus,
You would have to develop your own widget to display your MBeans.
If you know swing, you should be able to do that easily.
If you're not a GUI expert, then you might want to use tools like
NetBeans/Matisse to do that http://www.netbeans.org/
To access the data exposed by your MBeans, you simply need to
retrieve the MBeanServerConnection from JConsole context, and you can then
either use directly the MBeanServerConnection API - or create an MBean proxy
(or MXBean proxy if you're using MXBeans) for each of your custom M(X)Beans.
See this post for an example that shows how to use directly the MBeanServerConnection
API (use context.getMBeanServerConnection() instead of ManagementFactory.getMBeanServer())
http://blogs.sun.com/jmxetc/entry/a_small_program_that_prints
See this tutorial page to learn how to create and use proxies:
http://java.sun.com/docs/books/tutorial/jmx/remote/custom.html
Ignore the part about creating the connector etc... You already have the
MBeanServerConnection to the target's VM in your plugin's context.
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc