22.12.11
Apache Commons Modeler — Simple/Sample Usage
I’ve dealt in previous posts (here and on Cognitive Match‘s blog) with JMX and various things around it — as this is an area I have found more than useful in the JDK. It is therefore no surprise that recently I have turned my eyes to Apache Commons Modeler. The project lacks documentation, granted, and sometimes having the sources helps more than the JavaDoc (sorry, guys!) but nevertheless it is actually a handy tool. I am only guessing the reason why the project hasn’t maybe got the popularity it deserves amongst developers is because of Spring JMX — which in fact does pretty much what the Modeler does, however, there’s lots of developers “hooked” on Spring.
At the core of Modeler is the ModelMBean interface — for those of you unfamiliar with this, it allows a developer to wrap up any old Java class into an MBean which can be then managed via normal JMX means. In other words, you can take any class you want to export to JMX and without changing your class, without your class even “knowing” it’s going to be JMX‘d, you can do so — by the usage of a ModelMBean!

(3 votes, average: 4.67 out of 5)