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

Define a method to add a NotificationFilter locally or remotely

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 6
    • Fix Version/s: 7
    • Component/s: core-svc
    • Labels:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: