1 Reply Latest reply on Apr 27, 2004 6:15 PM by jcadams

    NotificationListener performance

    jcadams

      I have written a series of MBeans (and associated JUnit tests) that perform the following code within its start() method:


      MBeanServerNotificationFilter filter = new MBeanServerNotificationFilter();
      filter.enableAllObjectNames();
      filter.enableType(MBeanServerNotification.REGISTRATION_NOTIFICATION);
      filter.enableType(MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
      getMBeanServer().addNotificationListener(new ObjectName("JMImplementation:type=MBeanServerDelegate"), regListener, filter, null);



      I am also performing a JNDI lookup of the MBean server (using the RMIAdaptor method). When the stop() method of the MBean is called the notification listener is unregistered:


      getMBeanServer().removeNotificationListener(new ObjectName("JMImplementation:type=MBeanServerDelegate"), regListener);



      The first time I exercise the tests everything runs fine and all test complete. Every subsequent run the tests run much, much, MUCH slower. Any ideas on why the performance degrades?

      BTW: Running the tests within their own JVM/MBeanServer they do not exhibit this problem.

        • 1. Re: NotificationListener performance
          jcadams

          One additional item worth noting, my MBean is using RMI to communicate back information to a client application. When a hit from the registration listener occurs (that also matchs other criteria) a RMI method is invoked to let the client know.

          Don't know if that is important...