Vladimnir Vivien

Vladimir Vivien

Code Demos

JmxBuilder Demo - XML File Processor
To illustrate Groovy's JMX support, this demo code shows how to build a JMX agent and a JMX client using Groovy's JmxBuilder and GroovyMBean API's.

Motivation
Let's a assume that we want to build a system which validates incoming XML files to ensure, for instance, that external partners are sending valid XML data.  We decide to use an existing Java library to run the XML validation process via class XmlFileProcessor from the library (the validation type is inconsequential for the purpose of this demo).  The code in this demo shows how to use Groovy to easily create a functionally-complete JMX management agent around the XmlFileProcessor class to control and monitor the validation process.  The demo also includes code which shows how to use Groovy to build a management client to monitor the  process remotely.  The management client monitors and sends out an IM message via XMPP (Google Talk compatible) using Ignite Reatime's Smack API.

Download demo code