Version 2

    Can Non-MBeans Receive JMX Notifications?

     

    Although MBeans are typically the receivers of JMX notifications, this is

    not a requirement.

     

    Classes implementing the javax.management.NotificationListener interface

    can also subscribe/unsubscribe for notifications, using the following method,

    on the javax.management.MBeanServerConnection or javax.management.MBeanServer

    interfaces:

       ...
       void addNotificationListener(ObjectName name,
                                    NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                                    throws InstanceNotFoundException,
                                           IOException
       ...
       void removeNotificationListener(ObjectName name,
                                       NotificationListener listener)
                                       throws InstanceNotFoundException,
                                              ListenerNotFoundException,
                                              IOException
       void removeNotificationListener(ObjectName name,
                                       NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                       throws InstanceNotFoundException,
                                              ListenerNotFoundException,
                                              IOException
       ...                                       
    

    So any component (e.g. a servlet) that can get hold of the MBeanServer

    can potentially subscribe for notifications.

     

    Locating the MBeanServer is answered in this FAQ: HowCanIGetAReferenceToTheMBeanServer.

     

    Referenced by: