JmxConnectionPool.java 文件源码

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

项目:streamsx.jmxclients 作者:
@Override
public void handleNotification(Notification notification,
        Object handback) {
    JMXConnectionNotification connectionNotification = (JMXConnectionNotification) notification;
    // Should handle connectionID in the future to be specific
    // Be aware!! JMX failures log SEVERE messages that are not
    // coming from us
    LOGGER.trace("*** JMX Connection Notification: "
            + connectionNotification);
    LOGGER.trace("*** notification.getConnectionId(): "
            + connectionNotification.getConnectionId());
    LOGGER.trace("*** this.notificationId: " + mConnectionId);

    // Only reset connection if the notification is for the
    // connection at this endpoint
    if (!connectionNotification.getConnectionId().equals(
            mConnectionId)) {
        return;
    }

    String notificationType = connectionNotification.getType();

    if (notificationType
            .equals(JMXConnectionNotification.NOTIFS_LOST)
            || notificationType
                    .equals(JMXConnectionNotification.CLOSED)
            || notificationType
                    .equals(JMXConnectionNotification.FAILED)) {
        LOGGER.warn("*** Lost JMX Connection, scheduling reconnect and removing connection listener ...");
        // Remove connectionListener becuase often FAILED is follwed
        // by CLOSED and was causing multiple reconnects which stomp
        // on each other
        removeNotificationListener();

        notifyBeanSourceInterrupted(mStreamsBeanSource);
        // Could test to ensure we want to try and reconnect
        scheduleReconnect();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号