1 Reply Latest reply on Mar 6, 2007 11:57 AM by adrian.brock

    JMX Notification support

    starksm64

      Since notifications are part of the jmx interface the JMXIntroduction should be handling this. The question is how? I ran into this issue when looking to pojoize the Log4jService so that I could configure it properly during the bootstrap. It has a hard-coded notification generated when ever it reconfigures the log4j layer:

       protected void emitReconfigureNotification()
       {
       // emit a reconfigure notification with the configURL
       Notification n = new Notification(RECONFIGURE_NOTIFICATION_TYPE,
       this, getNextNotificationSequenceNumber(), "Log4j subsystem reconfigured");
       n.setUserData(configURL);
      
       super.sendNotification(n);
       }
      
      ...
      
       private void reconfigure(final URLConnection conn)
       {
       log.debug("Configuring from URL: " + configURL);
      ...
       // notify other mbeans that might be interested
       emitReconfigureNotification();
       }
      
      


      This really should be a post invocation aspect described by a pointcut on the reconfigure method. Wiring this together would seem to need a deployer in conjunction with the JMXIntroduction.


        • 1. Re: JMX Notification support

          The simplest implementation is to just extend NotificationBroadcasterSupport
          which will be picked up when you introduce the JMX aspect.

          But as you say, this type of thing should really be done with an AOP introduction.