Пример #1
0
  void cancelActiveServices() {
    cancelConnectThread();
    cancelConnectionMonitor();

    if (m_started) {
      removeActivationListener();
    }
    if (m_connectCntx != null) {
      m_connectCntx.reset();
    }
  }
Пример #2
0
  /** JMX callback notifying that the server has transitioned from started->active. */
  public void handleNotification(Notification notice, Object handback) {
    if (notice instanceof AttributeChangeNotification) {
      AttributeChangeNotification acn = (AttributeChangeNotification) notice;

      if (acn.getAttributeType().equals("jmx.terracotta.L2.active")) {
        m_active = true;
        removeActivationListener();
        if (m_connectListener != null) {
          m_connectListener.handleConnection();
        }
      } else if (acn.getAttributeType().equals("jmx.terracotta.L2.passive-uninitialized")) {
        m_passiveUninitialized = true;
        if (m_connectListener != null) {
          m_connectListener.handleConnection();
        }
      } else if (acn.getAttributeType().equals("jmx.terracotta.L2.passive-standby")) {
        m_passiveStandby = true;
        if (m_connectListener != null) {
          m_connectListener.handleConnection();
        }
      }
    }
  }