javax.management.Notification#setSource ( )源码实例Demo

下面列出了javax.management.Notification#setSource ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
源代码4 项目: openjdk-8   文件: DefaultMBeanServerInterceptor.java
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
源代码7 项目: jdk8u-jdk   文件: DefaultMBeanServerInterceptor.java
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
源代码8 项目: jdk8u-jdk   文件: DefaultMBeanServerInterceptor.java
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
源代码9 项目: hottub   文件: DefaultMBeanServerInterceptor.java
public void handleNotification(Notification notification,
                               Object handback) {
    if (notification != null) {
        if (notification.getSource() == mbean)
            notification.setSource(name);
    }

    /*
     * Listeners are not supposed to throw exceptions.  If
     * this one does, we could remove it from the MBean.  It
     * might indicate that a connector has stopped working,
     * for instance, and there is no point in sending future
     * notifications over that connection.  However, this
     * seems rather drastic, so instead we propagate the
     * exception and let the broadcaster handle it.
     */
    listener.handleNotification(notification, handback);
}
 
源代码10 项目: gemfirexd-oss   文件: CustomBean2.java
public void sendNotificationToMe(String name) {
  long sequence = sequenceNumber++;
  Notification n = new AttributeChangeNotification(this, sequenceNumber, System.currentTimeMillis(),
      name, "A", "long", sequence, sequenceNumber);
  n.setSource(RemoteTestModule.getMyVmid());
  sendNotification(n);
}
 
源代码11 项目: jdk8u-dev-jdk   文件: OldMBeanServerTest.java
public void handleNotification(
        Notification notification, Object handback) {
    if (notification.getSource() == userMBean)
        notification.setSource(name);
    userListener.handleNotification(notification, handback);
}
 
源代码12 项目: dragonwell8_jdk   文件: OldMBeanServerTest.java
public void handleNotification(
        Notification notification, Object handback) {
    if (notification.getSource() == userMBean)
        notification.setSource(name);
    userListener.handleNotification(notification, handback);
}
 
源代码13 项目: TencentKona-8   文件: OldMBeanServerTest.java
public void handleNotification(
        Notification notification, Object handback) {
    if (notification.getSource() == userMBean)
        notification.setSource(name);
    userListener.handleNotification(notification, handback);
}
 
源代码14 项目: hottub   文件: OldMBeanServerTest.java
public void handleNotification(
        Notification notification, Object handback) {
    if (notification.getSource() == userMBean)
        notification.setSource(name);
    userListener.handleNotification(notification, handback);
}
 
源代码15 项目: jdk8u60   文件: OldMBeanServerTest.java
public void handleNotification(
        Notification notification, Object handback) {
    if (notification.getSource() == userMBean)
        notification.setSource(name);
    userListener.handleNotification(notification, handback);
}
 
源代码16 项目: jdk8u_jdk   文件: OldMBeanServerTest.java
public void handleNotification(
        Notification notification, Object handback) {
    if (notification.getSource() == userMBean)
        notification.setSource(name);
    userListener.handleNotification(notification, handback);
}
 
源代码17 项目: openjdk-jdk8u-backup   文件: OldMBeanServerTest.java
public void handleNotification(
        Notification notification, Object handback) {
    if (notification.getSource() == userMBean)
        notification.setSource(name);
    userListener.handleNotification(notification, handback);
}
 
/**
 * Replaces the notification source if necessary to do so.
 * From the {@link Notification javadoc}:
 * <i>"It is strongly recommended that notification senders use the object name
 * rather than a reference to the MBean object as the source."</i>
 * @param notification the {@link Notification} whose
 * {@link javax.management.Notification#getSource()} might need massaging
 */
private void replaceNotificationSourceIfNecessary(Notification notification) {
	if (notification.getSource() == null || notification.getSource().equals(this.managedResource)) {
		notification.setSource(this.objectName);
	}
}
 
/**
 * Replaces the notification source if necessary to do so.
 * From the {@link Notification javadoc}:
 * <i>"It is strongly recommended that notification senders use the object name
 * rather than a reference to the MBean object as the source."</i>
 * @param notification the {@link Notification} whose
 * {@link javax.management.Notification#getSource()} might need massaging
 */
private void replaceNotificationSourceIfNecessary(Notification notification) {
	if (notification.getSource() == null || notification.getSource().equals(this.managedResource)) {
		notification.setSource(this.objectName);
	}
}
 
/**
 * From the {@link Notification javadoc}:
 * <p><i>"It is strongly recommended that notification senders use the object name
 * rather than a reference to the MBean object as the source."</i>
 * @param notification the {@link Notification} whose
 * {@link javax.management.Notification#getSource()} might need massaging
 */
private void replaceNotificationSourceIfNecessary(Notification notification) {
	if (notification.getSource() == null || notification.getSource().equals(this.managedResource)) {
		notification.setSource(this.objectName);
	}
}