0 Replies Latest reply on Nov 8, 2004 11:32 AM by Dimitris Andreadis

    Automatic notification subscription management for XMBeans?

    Dimitris Andreadis Master

      I just thought I could create an extention to the XMBean descriptor to allow for declarative handling of JMX subscription notification, ala
      org.jboss.system.NotificationListenerMBeanSupport.

      (see http://www.jboss.org/wiki/Wiki.jsp?page=SubscriptionList)

      The target resource (POJO) would just have to implement
      javax.management.NotificationListener (i.e. the handleNotification() method).

      In the XMBean descriptor you could write something like:

      ...
      <subscriptions>
       <dynamic>true</dynamic>
       <subscribe-after>start<subscribe-after>
       <unsubscribe-before>stop</unsubscribe-before>
       <subscription-list>
       <mbean name="JMImplementation:type=MBeanServerDelegate">
       <notification type="JMX.mbean.registered"/>
       </mbean>
       <subscription-list>
      <subscriptions>
      ...
      


      I have most of the code in ListenerServiceMBeanSupport, I just need to instantiate a new method interceptor in the presence of the "subscriptions" element that would subscribe after "start()" has returned and unsubscribe before "stop()" is called.

      How about that?