Just thought I'd share something I'd discovered:

If you have a class that implements the NotificationBroadcaster interface (sends JMX 
notifications) and you instrument it as a ModelMBean using the XMBean approach (by 
providing an XML description of the MBean interface), you must have a public method 
sendNotification(Notification notification) in your class for it to work.

I had a standard MBean that is a NotificationBroadcaster and I converted it to be a 
ModelMBean to take advantage of the persistence mechanism, but then it stopped 
working.  The reason is that my class was no longer the MBean, but was wrapped by the 
XMBean class.  In order for the XMBean to recognize that it needs to forward your 
class all the NotificationBroacaster stuff, it needs to see via reflection that your 
class has that sendNotification method.

>From the ModelMBeanInvoker.java class in the v3.2.3 source:

  |       /*
  |       If the managed resource is a NotificationBroadcaster and does have a public 
method
  |       sendNotification on it, set our notifier to it. The sendNotification call
  |       will be invoked through reflection on the resource.
  |       This is currently the only way an xmbean can send notifications.
  |       */
In case someone else comes across the same and is searching for the solution...

Regards,

Brett

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831841#3831841

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831841


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to