Often it might be necessary to expose a Plain Old Java Object as a JMX MBean for monitoring and management. Exposing a Plain Old Java Object as a JMX MBean is quite easy using the Spring framework's support. In this tutorial, we provide examples on how to do this, along with some tips and pitfalls to avoid. Check out the tutorial at the following URL:
-
Exposing a POJO as a JMX MBean with Spring (2 messages)
- Posted by: Fabrizio Chami
- Posted on: February 09 2011 12:00 EST
Threaded Messages (2)
- Exposing a POJO as a JMX MBean with Spring by Istvan Soos on February 10 2011 03:27 EST
- works for me by Greg Allen on February 10 2011 10:07 EST
-
Exposing a POJO as a JMX MBean with Spring[ Go to top ]
- Posted by: Istvan Soos
- Posted on: February 10 2011 03:27 EST
- in response to Fabrizio Chami
The example is just way too long. Why not use annotation config, with annotation JMX export (two lines in the xml) and @ManagedResource (one line for the class) @ManagedAttribute and @ManagedOperation (1-1 lines for methods/attrs)? I'm using it for years and works like a charm.
-
works for me[ Go to top ]
- Posted by: Greg Allen
- Posted on: February 10 2011 10:07 EST
- in response to Istvan Soos
I disagree. I was able easily cut and paste the xml into my existing config.
It allowed me to easily expose just one bean, that already is in good enough shape to be managed:
<bean id="executorService" class="java.util.concurrent.Executors" factory-method="newFixedThreadPool"
destroy-method="shutdownNow">
<constructor-arg value="${number.workers}" />
</bean>No way I could have used annotations there!