JDK-4718351 : RFE: Listen to a set of MBeans in a single operation
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
Could have the ability to do MBeanServer.addNotificationListener(wildcard,...) where wildcard is an ObjectName pattern such as new ObjectName("*:*").
The ability to subscribe to a set of MBeans will be part of the functionality of the Event Service. See CR 5108776. It will not be possible to use addNotificationListener(wildcard, ...). Instead you will need to get an EventClient and use its subscribe(wildcard, ...) method.
Ultimately we should define an EFD. We're not going to do that in
the JMX 1.2 timeframe, though.
Though an addNotificationListener that accepts a wildcard is attractive, the question arises of whether the listener applies only to the MBeans that existed at the time addNotificationListener was called (in which case you could have achieved the same thing, albeit more slowly, using a query and N calls to addNotificationListener); or whether the listener also applies to newly-registered MBeans that match the wildcard. In the latter case the MBean Server must maintain a list of current wildcards and apply it every time a new MBean is registered. Of course removeNotificationListener can be used to remove a wildcard from the list. Should there be a way to examine the list? This all seems a bit complicated and a Notification-handling MBean could be a better solution.