コード例 #1
0
ファイル: ChannelImpl.java プロジェクト: hellojvm/hornetq
  public void close() {
    if (closed) {
      return;
    }

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

    if (failingOver) {
      unlock();
    }
    closed = true;
  }
コード例 #2
0
ファイル: ChannelImpl.java プロジェクト: hellojvm/hornetq
  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;
    }
  }