--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java Fri Dec 05 21:59:09 2008 -0800
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java Tue Dec 09 12:01:07 2008 +0100
@@ -44,7 +44,6 @@
import javax.management.ImmutableDescriptor;
import javax.management.IntrospectionException;
import javax.management.InvalidAttributeValueException;
-import javax.management.JMX;
import javax.management.MBean;
import javax.management.MBeanAttributeInfo;
import javax.management.MBeanConstructorInfo;
@@ -538,6 +537,14 @@
}
}
+ /*
+ * Return the array of MBeanNotificationInfo for the given MBean object.
+ * If the object implements NotificationBroadcaster and its
+ * getNotificationInfo() method returns a non-empty array, then that
+ * is the result. Otherwise, if the object has a @NotificationInfo
+ * or @NotificationInfos annotation, then its contents form the result.
+ * Otherwise, the result is null.
+ */
static MBeanNotificationInfo[] findNotifications(Object moi) {
if (moi instanceof NotificationBroadcaster) {
MBeanNotificationInfo[] mbn =
@@ -553,6 +560,13 @@
}
return result;
}
+ } else {
+ try {
+ if (!MBeanInjector.injectsSendNotification(moi))
+ return null;
+ } catch (NotCompliantMBeanException e) {
+ throw new RuntimeException(e);
+ }
}
return findNotificationsFromAnnotations(moi.getClass());
}