The Java Management Extensions (JMX) technology represents a universal, open technology for management, and monitoring that can be deployed wherever
You can dyanamically attach BTrace to a Java process to inject trace code into it. BTrace client classescollect the trace output via a socket -- these client classes are used by BTrace command line client as well as VisualVM plugin for BTrace. How about attaching a JMX client to collect BTrace's trace data? Yes, it is possible to access a BTrace class's static fields as attributes of a MBean with this RFE.
There are two MBean samples in the BTrace repository. I attached both BTrace samples to a "Java2D demo" process. And then I attached VisualVM to view the Mbean registered by these BTrace samples:
|
VisualVM 1.0 is Now Available! VisualVM is a GUI-based, extensible, monitoring and performance analysis tool that is the next generation to the older, mostly CLI-based, tools in Sun's JDK distribution. VisualVM is part of the latest JDK: JDK 6 Update 7 (DZone, OnTheRecord, download) but it can monitor older JVMs. |
Plug-ins are key to the success of VisualVM. They can be loaded directly from the tool and the current list includes a JConsole Container Plugin (for backward compatiblity), and Plugins for GlassFish, BTrace and a Thread Dump Analyzer.
For more information check out:
• VisualVM home site,
ScreenCast at JavaOne,
Features.
• Plugins: web page,
Docs.
• Overviews at
InfoQ
and
DZone
• Overview/Intro Blogs:
Octavian,
Luis-Miguel
• Regular bloggers in the topic include
Luis-Miguel
and
Geertjan