ModelMBeanNotificationPublisher.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Send the supplied {@link Notification} using the wrapped
 * {@link ModelMBean} instance.
 * @param notification the {@link Notification} to be sent
 * @throws IllegalArgumentException if the supplied {@code notification} is {@code null}
 * @throws UnableToSendNotificationException if the supplied {@code notification} could not be sent
 */
@Override
public void sendNotification(Notification notification) {
    Assert.notNull(notification, "Notification must not be null");
    replaceNotificationSourceIfNecessary(notification);
    try {
        if (notification instanceof AttributeChangeNotification) {
            this.modelMBean.sendAttributeChangeNotification((AttributeChangeNotification) notification);
        }
        else {
            this.modelMBean.sendNotification(notification);
        }
    }
    catch (MBeanException ex) {
        throw new UnableToSendNotificationException("Unable to send notification [" + notification + "]", ex);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号