Exemple #1
0
  protected void setConnected(boolean connected) {
    if (m_connected != connected) {
      synchronized (this) {
        m_connected = connected;
        if (m_connected == false) {
          cancelActiveServices();
          m_active = m_started = m_passiveUninitialized = m_passiveStandby = false;
          if (isAutoConnect()) {
            startConnect();
          }
        } else { // connected
          cacheCredentials(ServerConnectionManager.this, getCredentials());
          m_started = true;
          if ((m_active = internalIsActive()) == false) {
            if ((m_passiveUninitialized = internalIsPassiveUninitialized()) == false) {
              m_passiveStandby = internalIsPassiveStandby();
            }
            addActivationListener();
          }
          initConnectionMonitor();
        }
      }

      // Notify listener that the connection state changed.
      if (m_connectListener != null) {
        m_connectListener.handleConnection();
      }
    }
  }
Exemple #2
0
  void tearDown() {
    cancelActiveServices();

    m_l2Info = null;
    m_serverHelper = null;
    m_connectCntx = null;
    m_connectListener = null;
    m_connectThread = null;
  }
Exemple #3
0
 /** Mark not-connected, notify, cancel connection monitor, don't startup auto-connect thread. */
 void disconnectOnExit() {
   cancelActiveServices();
   if (m_connected) {
     m_connected = false;
     if (m_connectListener != null) {
       m_connectListener.handleConnection();
     }
   }
 }
Exemple #4
0
 public void setAutoConnect(boolean autoConnect) {
   if (m_autoConnect != autoConnect) {
     if ((m_autoConnect = autoConnect) == true) {
       if (!m_connected) {
         startConnect();
       }
     } else {
       cancelActiveServices();
     }
   }
 }
Exemple #5
0
  public void setL2Info(L2Info l2Info) {
    cancelActiveServices();

    m_l2Info = l2Info;
    m_connectCntx = new ConnectionContext(l2Info);

    try {
      if (isAutoConnect()) {
        startConnect();
      }
    } catch (Exception e) {
      /**/
    }
  }