本文整理了Java中org.apache.coyote.Request.setReadListener
方法的一些代码示例,展示了Request.setReadListener
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setReadListener
方法的具体详情如下:
包路径:org.apache.coyote.Request
类名称: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);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!