Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java JMX Spring-何时是';JMXNotification';广播?_Java_Spring_Notifications_Jmx - Fatal编程技术网

Java JMX Spring-何时是';JMXNotification';广播?

Java JMX Spring-何时是';JMXNotification';广播?,java,spring,notifications,jmx,Java,Spring,Notifications,Jmx,我在查看JMX上的Spring时,遇到了以下段落: By configuring NotificationListeners in place, every time a JMX Notification is broadcast from the target MBean (bean:name=testBean1),the ConsoleLoggingNotificationListener bean that was registered as a listener via the noti

我在查看
JMX
上的
Spring
时,遇到了以下段落:

By configuring NotificationListeners in place, every time a JMX Notification is broadcast
from the target MBean (bean:name=testBean1),the ConsoleLoggingNotificationListener bean
that was registered as a listener via the notificationListenerMappings property will be 
notified.
这就是
控制台LoggingNotificationListener
的实现方式:

public class ConsoleLoggingNotificationListener
               implements NotificationListener, NotificationFilter {

    public void handleNotification(Notification notification, Object handback) {
        System.out.println(notification);
        System.out.println(handback);
    }

    public boolean isNotificationEnabled(Notification notification) {
        return AttributeChangeNotification.class.isAssignableFrom(notification.getClass());
    }
}
但是,由于我是新手,我想知道
JMX通知何时广播?是在JMX暴露属性的值更改时发生的吗

请帮我知道这件事


谢谢

我想这个问题与春天本身无关。如果我理解正确,这里的通知是

我没有读过,但乍一看似乎涵盖了相当广泛的主题


正如您所看到的,属性更改是广播通知时发生的事件之一。

可能有点太晚了。。然而,由于这个问题没有被接受的答案,我将发布我的答案

Spring文档还说:

Spring的JMX通知发布支持中的关键接口是NotificationPublisher接口(在org.springframework.JMX.export.notification包中定义)。任何将通过MBeanExporter实例导出为MBean的bean都可以实现相关的NotificationPublisherWare接口,以获得对NotificationPublisher实例的访问权。

你要找的答案在上面摘录的最后一句话中

参考: