Writing a JBoss Mbean, step-by-step
Posted by: Matt in Software development, tags: JBoss, jmx, mbeansI’ve recently been working on writing a Mbean for use in JBoss’ JMX Console. I was surprised how few pages were available that gave a step-by-step guide on how to do it. So, having gotten one working, I thought I’d share my findings on how to write a MBean for JBoss.
Problem Description
First, let’s describe the problem I’m solving in this example. JBoss provides some excellent pieces for monitoring your server’s health. One of the things I wanted to monitor was the various memory pools within the JVM (PermGen, Eden space, etc). I also needed an external monitoring to monitor this for me, and to send alerts when certain conditions are reached. This package we are using is able to read attributes from JMX Mbeans, so this was the means I decided to try using. If you go into the JBoss JMX console (at http://server/jmx-console) , and look under the jboss.system section, you will see an entry called type=ServerInfo.
If you click on it, and invoke the listMemoryPools() operation, you will see a highly useful report with ASCII graphs showing how the memory is going.
Read the rest of this entry »

Entries (RSS)