Interface NotificationPublisher
- All Known Implementing Classes:
ModelMBeanNotificationPublisher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Simple interface allowing Spring-managed MBeans to publish JMX notifications
without being aware of how those notifications are being transmitted to the
MBeanServer
.
Managed resources can access a NotificationPublisher
by
implementing the NotificationPublisherAware
interface. After a particular
managed resource instance is registered with the MBeanServer
,
Spring will inject a NotificationPublisher
instance into it if that
resource implements the NotificationPublisherAware
interface.
Each managed resource instance will have a distinct instance of a
NotificationPublisher
implementation. This instance will keep
track of all the NotificationListeners
registered for a particular managed 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.
- Since:
- 2.0
- Author:
- Rob Harrop
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
sendNotification
(Notification notification) Send the specifiedNotification
to all registeredNotificationListeners
.
-
Method Details
-
sendNotification
Send the specifiedNotification
to all registeredNotificationListeners
. Managed resources are not responsible for managing the list of registeredNotificationListeners
; that is performed automatically.- Parameters:
notification
- the JMX Notification to send- Throws:
UnableToSendNotificationException
- if sending failed
-