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

Javadoc unclear about Notification source replacement

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.2.0
    • core-svc
    • tiger
    • generic
    • generic
    • Verified

      The Javadoc for Notification says this:

      >> The Notification class represents a notification emitted by an MBean. It
      >> contains a reference to the source MBean: if
      >> the notification has been forwarded through the MBean server, this is the
      >> object name of the MBean. If the listener
      >> has registered directly with the MBean, this is either the object name
      >> or a direct reference to the MBean.

      This makes it look as if the MBean server always replaces the source with the ObjectName of the emitting MBean. But MBeanServer.addNotification says:

      "A notification emitted by the MBean will be forwarded by the MBeanServer to the listener. If the source of the notification is a reference to the MBean object, the MBean server will replace it by the MBean's ObjectName. Otherwise the source is unchanged."

      This is the behaviour implemented by the RI. The Javadoc for Notification should be rewritten to be consistent with it.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: