当前位置: 首页>>代码示例>>Java>>正文


Java JMXConnectionNotification.getType方法代码示例

本文整理汇总了Java中javax.management.remote.JMXConnectionNotification.getType方法的典型用法代码示例。如果您正苦于以下问题:Java JMXConnectionNotification.getType方法的具体用法?Java JMXConnectionNotification.getType怎么用?Java JMXConnectionNotification.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.management.remote.JMXConnectionNotification的用法示例。


在下文中一共展示了JMXConnectionNotification.getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleNotification

import javax.management.remote.JMXConnectionNotification; //导入方法依赖的package包/类
@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();
    }
}
 
开发者ID:IBMStreams,项目名称:streamsx.jmxclients,代码行数:40,代码来源:JmxConnectionPool.java

示例2: handleNotification

import javax.management.remote.JMXConnectionNotification; //导入方法依赖的package包/类
@Override
public void handleNotification(Notification notification, Object handback) {
  if (notification instanceof JMXConnectionNotification) {
    JMXConnectionNotification cxNotification = (JMXConnectionNotification) notification;
    String type = cxNotification.getType();
    if (JMXConnectionNotification.CLOSED.equals(type)) {
      this.securityService.logout();
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:11,代码来源:JMXShiroAuthenticator.java


注:本文中的javax.management.remote.JMXConnectionNotification.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。