At the core of Modeler is the ModelMBean interface — for those 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!
Unfortunately, for those of you who tried to use a ModelMBean — in fact same for DynamicMBean — the interfaces for creating these and defining the metadata for each bean can be quite clunky and awkward at times to use. I thought in the past, when working outside the Spring framework, that it would be so good to have a way to just say "here’s my class, a standard Java class, not aligned to any JMX naming conventions or anything — please register this somehow with JMX so I can inspect data through JMX Console". This is possible through Commons Modeler.
In this "how to", I'm going to start with a very simple bean and show how to wrap it up using Commons Modeler.