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

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

本文整理了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

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

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

  1. public void setReadListener(ReadListener listener) {
  2. coyoteRequest.setReadListener(listener);
  3. // The container is responsible for the first call to
  4. // listener.onDataAvailable(). If isReady() returns true, the container
  5. // needs to call listener.onDataAvailable() from a new thread. If
  6. // isReady() returns false, the socket will be registered for read and
  7. // the container will call listener.onDataAvailable() once data arrives.
  8. // Must call isFinished() first as a call to isReady() if the request
  9. // has been finished will register the socket for read interest and that
  10. // is not required.
  11. if (!coyoteRequest.isFinished() && isReady()) {
  12. coyoteRequest.action(ActionCode.DISPATCH_READ, null);
  13. if (!ContainerThreadMarker.isContainerThread()) {
  14. // Not on a container thread so need to execute the dispatch
  15. coyoteRequest.action(ActionCode.DISPATCH_EXECUTE, null);
  16. }
  17. }
  18. }

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

  1. public void setReadListener(ReadListener listener) {
  2. coyoteRequest.setReadListener(listener);
  3. // The container is responsible for the first call to
  4. // listener.onDataAvailable(). If isReady() returns true, the container
  5. // needs to call listener.onDataAvailable() from a new thread. If
  6. // isReady() returns false, the socket will be registered for read and
  7. // the container will call listener.onDataAvailable() once data arrives.
  8. // Must call isFinished() first as a call to isReady() if the request
  9. // has been finished will register the socket for read interest and that
  10. // is not required.
  11. if (!coyoteRequest.isFinished() && isReady()) {
  12. coyoteRequest.action(ActionCode.DISPATCH_READ, null);
  13. if (!ContainerThreadMarker.isContainerThread()) {
  14. // Not on a container thread so need to execute the dispatch
  15. coyoteRequest.action(ActionCode.DISPATCH_EXECUTE, null);
  16. }
  17. }
  18. }

相关文章

Request类方法