Jeff Mesnil
Weblog · Dev · Photos · Books

JRuby Cookbook Has a Section About jmx4r

November 26, 2008

I noticed today that O'Reilly just released JRuby Cookbook. I have a few ideas I'd like to implement using JRuby and I was browsing the table of contents to check if the book could be helpful.

I was pleasantly surprised to see that it contains a section about "Performing Remote Management with JMX" using jmx4r (you can read a preview of the section by expanding it from the table of contents).

I'm obviously biased but I deeply believe that a small library such as jmx4r (less than 200 SLOC for the main file and 1/3 are comments) shows what the combination of Ruby and Java can achieve.
JRuby leverages the strong Java runtime (with its garbage collection and hotspot) and allows to access a wide range of Java libraries with all the strengths of the Ruby language.

For example, in jmx4r case, I extensively use Ruby metaprogramming toolset to dynamically create the properties and methods correponding to the MBean attributes and operations.

There are also other stories which demonstrates what JRuby brings to the table coming from the C-Ruby world.

I'm looking forward to read this cookbook and write some ruby code built on top of the Java platform.