JDK-6611518 : Define a method to add a NotificationFilter locally or remotely
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2007-10-01
  • Updated: 2010-07-29
  • Resolved: 2008-09-19
Related Reports
Relates :  
Relates :  
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.

Comments
EVALUATION This method has somewhat vague semantics and is being abandoned in favour of an approach allowing code to discover the JMX spec version of the remote agent and use that information to decide how to proceed. See 6750008.
19-09-2008

EVALUATION Important to make QueryNotificationFilter interoperable.
01-10-2007