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

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

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

Request.setReadListener介绍

暂无

代码示例

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

public void setReadListener(ReadListener listener) {
  coyoteRequest.setReadListener(listener);
  // The container is responsible for the first call to
  // listener.onDataAvailable(). If isReady() returns true, the container
  // needs to call listener.onDataAvailable() from a new thread. If
  // isReady() returns false, the socket will be registered for read and
  // the container will call listener.onDataAvailable() once data arrives.
  // Must call isFinished() first as a call to isReady() if the request
  // has been finished will register the socket for read interest and that
  // is not required.
  if (!coyoteRequest.isFinished() && isReady()) {
    coyoteRequest.action(ActionCode.DISPATCH_READ, null);
  }
}

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

public void setReadListener(ReadListener listener) {
  coyoteRequest.setReadListener(listener);
  // The container is responsible for the first call to
  // listener.onDataAvailable(). If isReady() returns true, the container
  // needs to call listener.onDataAvailable() from a new thread. If
  // isReady() returns false, the socket will be registered for read and
  // the container will call listener.onDataAvailable() once data arrives.
  // Must call isFinished() first as a call to isReady() if the request
  // has been finished will register the socket for read interest and that
  // is not required.
  if (!coyoteRequest.isFinished() && isReady()) {
    coyoteRequest.action(ActionCode.DISPATCH_READ, null);
    if (!ContainerThreadMarker.isContainerThread()) {
      // Not on a container thread so need to execute the dispatch
      coyoteRequest.action(ActionCode.DISPATCH_EXECUTE, null);
    }
  }
}

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

public void setReadListener(ReadListener listener) {
  coyoteRequest.setReadListener(listener);
  // The container is responsible for the first call to
  // listener.onDataAvailable(). If isReady() returns true, the container
  // needs to call listener.onDataAvailable() from a new thread. If
  // isReady() returns false, the socket will be registered for read and
  // the container will call listener.onDataAvailable() once data arrives.
  // Must call isFinished() first as a call to isReady() if the request
  // has been finished will register the socket for read interest and that
  // is not required.
  if (!coyoteRequest.isFinished() && isReady()) {
    coyoteRequest.action(ActionCode.DISPATCH_READ, null);
    if (!ContainerThreadMarker.isContainerThread()) {
      // Not on a container thread so need to execute the dispatch
      coyoteRequest.action(ActionCode.DISPATCH_EXECUTE, null);
    }
  }
}

相关文章

微信公众号

最新文章

更多

Request类方法