Class ModelMBeanNotificationPublisher
- java.lang.Object
- org.springframework.jmx.export.notification.ModelMBeanNotificationPublisher
- All Implemented Interfaces:
NotificationPublisher
public class ModelMBeanNotificationPublisher extends Object implements NotificationPublisher
NotificationPublisher
implementation that uses the infrastructure provided by theModelMBean
interface to trackjavax.management.NotificationListeners
and sendNotifications
to those listeners.- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller, Rick Evans
- See Also:
ModelMBeanNotificationBroadcaster
,NotificationPublisherAware
Constructor Summary
Constructors Constructor Description ModelMBeanNotificationPublisher(ModelMBeanNotificationBroadcaster modelMBean, ObjectName objectName, Object managedResource)
Create a new instance of theModelMBeanNotificationPublisher
class that will publish allNotifications
to the suppliedModelMBean
.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
sendNotification(Notification notification)
Send the suppliedNotification
using the wrappedModelMBean
instance.
Constructor Detail
ModelMBeanNotificationPublisher
public ModelMBeanNotificationPublisher(ModelMBeanNotificationBroadcaster modelMBean, ObjectName objectName, Object managedResource)
Create a new instance of theModelMBeanNotificationPublisher
class that will publish allNotifications
to the suppliedModelMBean
.- Parameters:
modelMBean
- the targetModelMBean
; must not benull
objectName
- theObjectName
of the sourceModelMBean
managedResource
- the managed resource exposed by the suppliedModelMBean
- Throws:
IllegalArgumentException
- if any of the parameters isnull
Method Detail
sendNotification
public void sendNotification(Notification notification)
Send the suppliedNotification
using the wrappedModelMBean
instance.- Specified by:
sendNotification
in interfaceNotificationPublisher
- Parameters:
notification
- theNotification
to be sent- Throws:
IllegalArgumentException
- if the suppliednotification
isnull
UnableToSendNotificationException
- if the suppliednotification
could not be sent