gpt4 book ai didi

org.apache.catalina.tribes.io.XByteBuffer.extractDataPackage()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 17:13:40 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.catalina.tribes.io.XByteBuffer.extractDataPackage()方法的一些代码示例,展示了XByteBuffer.extractDataPackage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XByteBuffer.extractDataPackage()方法的具体详情如下:
包路径:org.apache.catalina.tribes.io.XByteBuffer
类名称:XByteBuffer
方法名:extractDataPackage

XByteBuffer.extractDataPackage介绍

[英]Extracts the message bytes from a package. If no package exists, a IllegalStateException will be thrown.
[中]从包中提取消息字节。如果不存在包,将抛出非法状态异常。

代码示例

代码示例来源:origin: codefollower/Tomcat-Research

public ChannelData extractPackage(boolean clearFromBuffer) {
  XByteBuffer xbuf = extractDataPackage(clearFromBuffer);
  ChannelData cdata = ChannelData.getDataFromPackage(xbuf);
  return cdata;
}

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

public ChannelData extractPackage(boolean clearFromBuffer) throws java.io.IOException {
  XByteBuffer xbuf = extractDataPackage(clearFromBuffer);
  ChannelData cdata = ChannelData.getDataFromPackage(xbuf);
  return cdata;
}

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

public ChannelData extractPackage(boolean clearFromBuffer) {
  XByteBuffer xbuf = extractDataPackage(clearFromBuffer);
  ChannelData cdata = ChannelData.getDataFromPackage(xbuf);
  return cdata;
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

public ChannelData extractPackage(boolean clearFromBuffer) throws java.io.IOException {
  XByteBuffer xbuf = extractDataPackage(clearFromBuffer);
  ChannelData cdata = ChannelData.getDataFromPackage(xbuf);
  return cdata;
}

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

protected boolean read(SelectionKey key) throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException("Unable to receive an ack message. EOF on socket channel has been reached.");
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

protected boolean read() throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = isUdpBased()?dataChannel.read(readbuf) : socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException("Unable to receive an ack message. EOF on socket channel has been reached.");
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

protected boolean read(SelectionKey key) throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = isUdpBased()?dataChannel.read(readbuf) : socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException("Unable to receive an ack message. EOF on socket channel has been reached.");
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException("Received a failed ack:org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA");
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

protected boolean read() throws IOException {
  //if there is no message here, we are done
  if ( current == null ) return true;
  int read = isUdpBased()?dataChannel.read(readbuf) : socketChannel.read(readbuf);
  //end of stream
  if ( read == -1 ) throw new IOException(sm.getString("nioSender.unable.receive.ack"));
  //no data read
  else if ( read == 0 ) return false;
  readbuf.flip();
  ackbuf.append(readbuf,read);
  readbuf.clear();
  if (ackbuf.doesPackageExist() ) {
    byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
    boolean ack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
    boolean fack = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);
    if ( fack && getThrowOnFailedAck() ) throw new RemoteProcessException(sm.getString("nioSender.receive.failedAck"));
    return ack || fack;
  } else {
    return false;
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
  failAckReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);

代码示例来源:origin: org.apache.geronimo.ext.tomcat/tribes

ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
  failAckReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);

代码示例来源:origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
  failAckReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);

代码示例来源:origin: org.apache.tomcat/tomcat-tribes

ackbuf.append(d);
if (ackbuf.doesPackageExist() ) {
  byte[] ackcmd = ackbuf.extractDataPackage(true).getBytes();
  ackReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.ACK_DATA);
  failAckReceived = Arrays.equals(ackcmd,org.apache.catalina.tribes.transport.Constants.FAIL_ACK_DATA);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com