org.apache.coyote.Response.getWriteListener()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(148)

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

Response.getWriteListener介绍

暂无

代码示例

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

/**
 * Is standard Servlet blocking IO being used for output?
 */
protected final boolean isBlocking() {
  return response.getWriteListener() == null;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Is standard Servlet blocking IO being used for output?
 * @return <code>true</code> if this is blocking IO
 */
protected final boolean isBlocking() {
  return response.getWriteListener() == null;
}

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

public boolean isBlocking() {
  return coyoteResponse.getWriteListener() == null;
}

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

public boolean isBlocking() {
  return coyoteResponse.getWriteListener() == null;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

public boolean isBlocking() {
  return coyoteResponse.getWriteListener() == null;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

if (flush(true, coyoteResponse.getWriteListener() == null)) {
  totalThisTime += chunk.remaining();
  writeBuffer.add(chunk);

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

sm.getString("response.nullWriteListener"));
if (getWriteListener() != null) {
  throw new IllegalStateException(
      sm.getString("response.writeListenerSet"));

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

private void writeData(ByteBuffer chunk) throws IOException {
  boolean blocking = (response.getWriteListener() == null);
  int len = chunk.remaining();
  int off = 0;
  // Write this chunk
  while (len > 0) {
    int thisTime = Math.min(len, outputMaxChunkSize);
    responseMessage.reset();
    responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK);
    chunk.limit(chunk.position() + thisTime);
    responseMessage.appendBytes(chunk);
    responseMessage.end();
    socketWrapper.write(blocking, responseMessage.getBuffer(), 0, responseMessage.getLen());
    socketWrapper.flush(blocking);
    len -= thisTime;
    off += thisTime;
  }
  bytesWritten += off;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
final synchronized void incrementWindowSize(int windowSizeIncrement) throws Http2Exception {
  // If this is zero then any thread that has been trying to write for
  // this stream will be waiting. Notify that thread it can continue. Use
  // notify all even though only one thread is waiting to be on the safe
  // side.
  boolean notify = getWindowSize() < 1;
  super.incrementWindowSize(windowSizeIncrement);
  if (notify && getWindowSize() > 0) {
    if (coyoteResponse.getWriteListener() == null) {
      // Blocking, so use notify to release StreamOutputBuffer
      notifyAll();
    } else {
      // Non-blocking so dispatch
      coyoteResponse.action(ActionCode.DISPATCH_WRITE, null);
      // Need to explicitly execute dispatches on the StreamProcessor
      // as this thread is being processed by an UpgradeProcessor
      // which won't see this dispatch
      coyoteResponse.action(ActionCode.DISPATCH_EXECUTE, null);
    }
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

sm.getString("response.nullWriteListener"));
if (getWriteListener() != null) {
  throw new IllegalStateException(
      sm.getString("response.writeListenerSet"));

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

flush(getCoyoteResponse().getWriteListener() == null);

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

RequestDispatcher.ERROR_EXCEPTION);
req.getAttributes().remove(RequestDispatcher.ERROR_EXCEPTION);
if (res.getWriteListener() != null) {
  ClassLoader oldCL =
      Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(newCL);
    res.getWriteListener().onError(t);
  } finally {
    Thread.currentThread().setContextClassLoader(oldCL);
WriteListener writeListener = res.getWriteListener();
ReadListener readListener = req.getReadListener();
if (writeListener != null && status == SocketStatus.OPEN_WRITE) {

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

private void writeData(ByteChunk chunk) throws IOException {
  // Prevent timeout
  socketWrapper.access();
  boolean blocking = (response.getWriteListener() == null);
  if (!blocking) {
    flushBufferedData();
  }
  int len = chunk.getLength();
  int off = 0;
  // Write this chunk
  while (responseMsgPos == -1 && len > 0) {
    int thisTime = len;
    if (thisTime > outputMaxChunkSize) {
      thisTime = outputMaxChunkSize;
    }
    responseMessage.reset();
    responseMessage.appendByte(Constants.JK_AJP13_SEND_BODY_CHUNK);
    responseMessage.appendBytes(chunk.getBytes(), chunk.getOffset() + off, thisTime);
    responseMessage.end();
    writeResponseMessage(blocking);
    len -= thisTime;
    off += thisTime;
  }
  bytesWritten += off;
  if (len > 0) {
    // Add this chunk to the buffer
    addToBuffers(chunk.getBuffer(), off, len);
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

if (coyoteResponse.getWriteListener() == null) {
  if (log.isDebugEnabled()) {
    log.debug(sm.getString("upgradeHandler.notifyAll",

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public final SocketState dispatch(SocketEvent status) {
  if (status == SocketEvent.OPEN_WRITE && response.getWriteListener() != null) {
    asyncStateMachine.asyncOperation();
    try {
    if (request.getReadListener() != null || response.getWriteListener() != null) {

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

req.getReadListener().onError(t);
  if (res.getWriteListener() != null) {
    res.getWriteListener().onError(t);
WriteListener writeListener = res.getWriteListener();
ReadListener readListener = req.getReadListener();
if (writeListener != null && status == SocketEvent.OPEN_WRITE) {

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

req.getReadListener().onError(t);
  if (res.getWriteListener() != null) {
    res.getWriteListener().onError(t);
WriteListener writeListener = res.getWriteListener();
ReadListener readListener = req.getReadListener();
if (writeListener != null && status == SocketEvent.OPEN_WRITE) {

相关文章