|
|
|||||||||||||||||||||||||||||||||||||||||||||
Eamonn McManus's BlogPlaying with the JMX 2.0 APIPosted by emcmanus on August 06, 2008 at 09:42 AM | Comments (5)Version 2.0 of the JMX API is being defined by JSR 255. I've written about some of the features in the new API before. They are trickling into the JDK 7 sources over time, so you can now play with some shiny new things. Here's a description of what they are, and how you can even access them from JDK 6 if you are brave. As you probably know, the JDK 7 platform is being developed in open source, which means that you can see the changes as soon as the JMX team commits them. You can browse the current mainline JDK 7 sources directly from the Mercurial repository, at http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/tip. These sources correspond to the Javadoc snapshot at http://download.java.net/jdk7/docs/api/index.html, and to the JDK 7 snapshot binary at http://download.java.net/jdk7/binaries/. If you download the JDK 7 snapshot binary, you can use it the same way you would use any other JDK installation. Of course, this is work in progress, so don't use it for anything critical. But it tends to be surprisingly stable, and I often use it to run NetBeans, for example. Recent JMX API changes in the JDK 7 sourcesYou can also see all of the changes that have gone into the JDK 7 sources at http://hg.openjdk.java.net/jdk7/jdk7/jdk/shortlog. At the time of writing, one interesting thing you will see there (if you find the JMX API interesting) is this:
Changes that are on the wayFor a project as big and important as the JDK 7 project,
there's a lot of extra engineering that has to happen between
the time the JMX team pushes a change into a publicly-visible
repository and the time that change actually shows up in the
snapshots. I think of the changes as being "in the pipes"
during this time. You can see our changes as soon as we push
them by looking
at http://hg.openjdk.java.net/jdk7/tl/jdk.
(Here, At the time of writing, this will show the change There are two other chunks of functionality that should be showing up in the next couple of months, one big and one somewhat smaller. The big one is namespaces. The smaller one is the stuff that will build on namespaces to support "client contexts" (also described in the slides at that link) and localization of descriptions in MBeanInfo. Once those are in we will be looking at a smallish subset of the various RFEs open against the JMX API. Now would be a good time to agitate for anything you particularly want to see. Using the JMX 2.0 API with the JDK 6 platformUsing the JDK 7 sources, you can in fact build a jar with just the JMX classes and run that with a JDK 6 installation. Of course this is even less supported than running a JDK 7 snapshot, but once again assuming you're not using it for anything critical here's how you would go about it. First download the JDK 7 sources, either using Mercurial if you have it, with a command like this... hg clone http://hg.openjdk.java.net/jdk7/jdk myjdk ...or by downloading the sources from http://download.java.net/jdk7/. The "JDK 7 Source under the JRL license" link on that page is a jar which you download and run using a command like this... java -jar jdk-7-ea-src-b32-jrl-04_aug_2008.jar Now cd to the jdk subdirectory of the sources, if you downloaded the bundle, or into the Mercurial repository you cloned if you did that (you only cloned the jdk subdirectory). Run this command... ant -f make/netbeans/jmx/build.xml If it works, it'll make you a Now you can use your new The second way is to run your programs like this... java -Xbootclasspath/p:/path/to/jmx.jar ... Then only programs that are explicitly run in that way will be using the new JMX implementation. Let us know how you get onIf you play with the new JMX API, or even if you are just browsing through it, we're very interested in hearing about your experiences. Feel free to add your comments here, or send mail to jmx-spec-comments@sun.com, or write a blog entry with tag "jmx". Thanks! Bookmark blog post: CommentsComments are listed in date ascending order (oldest first) | Post Comment
| |||||||||||||||||||||||||||||||||||||||||||||
|
|