JDK-6774918 : @NotificationInfo is ineffective on MBeans that cannot send notifications
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-11-21
  • Updated: 2017-05-16
  • Resolved: 2011-04-19
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.

To download the current JDK release, click here.
7 b43Fixed
Related Reports
Relates :  
The new @NotificationInfo annotation allows you to define the contents of the MBeanNotificationInfo[] array inside the MBeanInfo of an MBean.  But it is currently allowed on any MBean, even one that cannot emit notifications.  That is likely to cause confusion.

EVALUATION On further reflection, we will allow @NotificationInfo even if the MBean is not a notification source, but it will be ignored in that case. So we will not have the invidious situation where we advertise in the MBeanInfo that the MBean can emit notifications of certain types, but then refuse to allow addNotificationListener. The idea is that @NotificationInfo says what the notifications are if the MBean can emit notifications, and is otherwise ignored. The motivation for doing this is two-fold. First, we can add @NotificationInfo to the existing javax.management and java.lang.management interfaces that represent MBeans whose standard implementations can emit notifications, without breaking existing code that might implement those interfaces with MBeans that do not emit notifications. Second, users can put this annotation on an interface to specify optional notification behaviour. If the MBean is a notification source, then the annotation says what notifications it can emit. If it is not a notification source, then the annotation is ignored. We will also specify that @NotificationInfo is ignored if the MBean implements NotificationBroadcaster and returns a non-empty MBeanNotificationInfo[] from the getNotificationInfo() method.

EVALUATION We should specify that the @NotificationInfo and @NotificationInfos annotation are only valid if JMX.isNotificationSource(mbean) is true.