Esempio n. 1
0
  public void close() {
    if (closed) {
      return;
    }

    if (!connection.isDestroyed() && !connection.removeChannel(id)) {
      throw HornetQClientMessageBundle.BUNDLE.noChannelToClose(id);
    }

    if (failingOver) {
      unlock();
    }
    closed = true;
  }
Esempio n. 2
0
  public void transferConnection(final CoreRemotingConnection newConnection) {
    // Needs to synchronize on the connection to make sure no packets from
    // the old connection get processed after transfer has occurred
    synchronized (connection.getTransferLock()) {
      connection.removeChannel(id);

      // And switch it

      final CoreRemotingConnection rnewConnection = newConnection;

      rnewConnection.putChannel(id, this);

      connection = rnewConnection;

      transferring = true;
    }
  }