In case you don't already know, ListenerServiceMBeanSupport is a cool subclass that you can extend if you want to write MBean services that are jmx notification listeners, too.

 

It solves the problem of subscribing for notifications, by externalizing the subscription configuration in XML, no matter how complex it is. It has some nice features like you can use ObjectName patterns (e.g. subscribe to all mbeans in the jboss.system domain (jboss.system:*) and it supports dynamic subscriptions too, that is, the baseclass will monitor new mbean registration and it'll subscribe to them if they match the subscription specification you have provided, even AFTER your service is started . You just need to write the callback (handleNotification2()) to process the received notifications. (Have a look at an example here.)

 

Starting from JBoss v3.2.8RC1 & v.4.0.2RC1, this mechanism has been extended to support arbitrary filters, too, using a filter factory plugin mechanism. (Previously you were only able to specify a NotificationFilterSupport filter.)

 

To learn all about this, take a look at the SubscriptionList examples in the Wiki documentation.

 

If you have some rather peculiar JMX notification subscription scenario that you cannot implement using ListenerServiceMBeanSupport, I'd be very interested to hear about, so please do post a message at the Users, Management,JMX/JBoss forum.

 

Enjoy!

 

dimitris@jboss