Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6611518

Define a method to add a NotificationFilter locally or remotely

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 7
    • 6
    • core-svc

      CR 6610917 introduces a new generic NotificationFilter class called QueryNotificationFilter. This removes the need to write custom NotificationFilter implementations in most cases. But when connecting to a remote JMX agent, the QueryNotificationFilter class will only be available if the agent is running at least version 2.0 of the JMX API (i.e., usually, it is at least Java SE 7). It is tedious to check this, and it will often not be possible for a general-purpose client to know that all agents it will connect to are at least 2.0.

      The proposed solution is to introduce a new method addListenerWithFilter that attempts to do MBeanServerConnection.addNotificationListener with the given filter, and if that produces an exception wrapping a ClassNotFoundException, instead arranges for the filter to be run on the client rather than the server. A corresponding method removeListenerWithFilter does MBeanServerConnection.removeNotificationListener in a way that works regardless of whether the filter is local or remote.

      The new methods could be in the class javax.management.JMX, or one of the new classes introduced by the Event Service.

            emcmanus Eamonn McManus
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: