本文整理汇总了Java中org.springframework.jmx.export.notification.NotificationPublisherAware类的典型用法代码示例。如果您正苦于以下问题:Java NotificationPublisherAware类的具体用法?Java NotificationPublisherAware怎么用?Java NotificationPublisherAware使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotificationPublisherAware类属于org.springframework.jmx.export.notification包,在下文中一共展示了NotificationPublisherAware类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: injectNotificationPublisherIfNecessary
import org.springframework.jmx.export.notification.NotificationPublisherAware; //导入依赖的package包/类
/**
* If the supplied managed resource implements the {@link NotificationPublisherAware} an instance of
* {@link org.springframework.jmx.export.notification.NotificationPublisher} is injected.
*/
private void injectNotificationPublisherIfNecessary(
Object managedResource, ModelMBean modelMBean, ObjectName objectName) {
if (managedResource instanceof NotificationPublisherAware) {
((NotificationPublisherAware) managedResource).setNotificationPublisher(
new ModelMBeanNotificationPublisher(modelMBean, objectName, managedResource));
}
}