接口 NotificationPublisher
- 所有已知实现类:
ModelMBeanNotificationPublisher
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface NotificationPublisher
Simple interface allowing Spring-managed MBeans to publish JMX notifications without being aware of how those notifications are being transmitted to theMBeanServer.Managed resources can access a
NotificationPublisherby implementing theNotificationPublisherAwareinterface. After a particular managed resource instance is registered with theMBeanServer, Spring will inject aNotificationPublisherinstance into it if that resource implements theNotificationPublisherAwareinterface.Each managed resource instance will have a distinct instance of a
NotificationPublisherimplementation. This instance will keep track of all theNotificationListenersregistered for a particular mananaged resource.Any existing, user-defined MBeans should use standard JMX APIs for notification publication; this interface is intended for use only by Spring-created MBeans.
- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop
- 另请参阅:
NotificationPublisherAware,MBeanExporter
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidsendNotification(Notification notification)Send the specifiedNotificationto all registeredNotificationListeners.
方法详细资料
sendNotification
void sendNotification(Notification notification) throws UnableToSendNotificationException
Send the specifiedNotificationto all registeredNotificationListeners. Managed resources are not responsible for managing the list of registeredNotificationListeners; that is performed automatically.- 参数:
notification- the JMX Notification to send- 抛出:
UnableToSendNotificationException- if sending failed