Just in time for the release of JRuby 1.0 and following my experiments with writing JRuby scripts to manage remote applications using JMX (part I & II), I created jmx4r, a simple library which makes it super easy to write such scripts.
For example, to trigger a Garbage Collection on a remote Java application , the whole script is:
require 'java'
require 'jmx4r'
memory = JMX::MBean.find_by_name "java.lang:type=Memory"
memory.verbose = true
memory.gc
Simple enough, isn’t it?
