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

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

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

Request.getReadListener介绍

暂无

代码示例

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

boolean isBlocking() {
  return coyoteRequest.getReadListener() == null;
}

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

boolean isBlocking() {
  return coyoteRequest.getReadListener() == null;
}

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

boolean isBlocking() {
  return coyoteRequest.getReadListener() != null;
}

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

public boolean isReady() {
  if (coyoteRequest.getReadListener() == null) {
    throw new IllegalStateException("not in non blocking mode.");
  }
  int available = available();
  boolean result = available > 0;
  if (!result) {
    coyoteRequest.action(ActionCode.NB_READ_INTEREST, null);
  }
  return result;
}

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

public int available() {
  int available = 0;
  if (state == BYTE_STATE) {
    available = bb.remaining();
  } else if (state == CHAR_STATE) {
    available = cb.remaining();
  }
  if (available == 0) {
    coyoteRequest.action(ActionCode.AVAILABLE,
        Boolean.valueOf(coyoteRequest.getReadListener() != null));
    available = (coyoteRequest.getAvailable() > 0) ? 1 : 0;
  }
  return available;
}

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

public int available() {
  int available = availableInThisBuffer();
  if (available == 0) {
    coyoteRequest.action(ActionCode.AVAILABLE,
        Boolean.valueOf(coyoteRequest.getReadListener() != null));
    available = (coyoteRequest.getAvailable() > 0) ? 1 : 0;
  }
  return available;
}

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

public void setReadListener(ReadListener listener) {
  if (listener == null) {
    throw new NullPointerException(
        sm.getString("request.nullReadListener"));
  }
  if (getReadListener() != null) {
    throw new IllegalStateException(
        sm.getString("request.readListenerSet"));
  }
  // Note: This class is not used for HTTP upgrade so only need to test
  //       for async
  AtomicBoolean result = new AtomicBoolean(false);
  action(ActionCode.ASYNC_IS_ASYNC, result);
  if (!result.get()) {
    throw new IllegalStateException(
        sm.getString("request.notAsync"));
  }
  this.listener = listener;
}

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

public void setReadListener(ReadListener listener) {
  if (listener == null) {
    throw new NullPointerException(
        sm.getString("request.nullReadListener"));
  }
  if (getReadListener() != null) {
    throw new IllegalStateException(
        sm.getString("request.readListenerSet"));
  }
  // Note: This class is not used for HTTP upgrade so only need to test
  //       for async
  AtomicBoolean result = new AtomicBoolean(false);
  action(ActionCode.ASYNC_IS_ASYNC, result);
  if (!result.get()) {
    throw new IllegalStateException(
        sm.getString("request.notAsync"));
  }
  this.listener = listener;
}

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

public boolean isReady() {
  if (coyoteRequest.getReadListener() == null) {
    if (log.isDebugEnabled()) {
      log.debug(sm.getString("inputBuffer.requiresNonBlocking"));

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

public boolean isReady() {
  if (coyoteRequest.getReadListener() == null) {
    if (log.isDebugEnabled()) {
      log.debug(sm.getString("inputBuffer.requiresNonBlocking"));
    }
    return false;
  }
  if (isFinished()) {
    // If this is a non-container thread, need to trigger a read
    // which will eventually lead to a call to onAllDataRead() via a
    // container thread.
    if (!ContainerThreadMarker.isContainerThread()) {
      coyoteRequest.action(ActionCode.DISPATCH_READ, null);
      coyoteRequest.action(ActionCode.DISPATCH_EXECUTE, null);
    }
    return false;
  }
  boolean result = available() > 0;
  if (!result) {
    coyoteRequest.action(ActionCode.NB_READ_INTEREST, null);
  }
  return result;
}

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

RequestDispatcher.ERROR_EXCEPTION);
req.getAttributes().remove(RequestDispatcher.ERROR_EXCEPTION);
ReadListener readListener = req.getReadListener();
if (readListener != null) {
  ClassLoader oldCL =
ReadListener readListener = req.getReadListener();
if (writeListener != null && status == SocketStatus.OPEN_WRITE) {
  ClassLoader oldCL =

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

if (asyncConImpl != null) {
  async = true;
  ReadListener readListener = req.getReadListener();
  if (readListener != null && request.isFinished()) {
      Thread.currentThread().setContextClassLoader(newCL);
      if (req.sendAllDataReadEvent()) {
        req.getReadListener().onAllDataRead();

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

request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, ioe);
} else if (status == SocketEvent.OPEN_READ && request.getReadListener() != null) {
  dispatchNonBlockingRead();
} else if (status == SocketEvent.ERROR) {
  if (request.getReadListener() != null || response.getWriteListener() != null) {

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

ReadListener readListener = req.getReadListener();
if (readListener != null && request.isFinished()) {
    oldCL = request.getContext().bind(false, null);
    if (req.sendAllDataReadEvent()) {
      req.getReadListener().onAllDataRead();

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

try {
  oldCL = request.getContext().bind(false, null);
  if (req.getReadListener() != null) {
    req.getReadListener().onError(t);
ReadListener readListener = req.getReadListener();
if (writeListener != null && status == SocketEvent.OPEN_WRITE) {
  ClassLoader oldCL = null;

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

try {
  oldCL = request.getContext().bind(false, null);
  if (req.getReadListener() != null) {
    req.getReadListener().onError(t);
ReadListener readListener = req.getReadListener();
if (writeListener != null && status == SocketEvent.OPEN_WRITE) {
  ClassLoader oldCL = null;

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

ReadListener readListener = req.getReadListener();
if (readListener != null && request.isFinished()) {
    oldCL = request.getContext().bind(false, null);
    if (req.sendAllDataReadEvent()) {
      req.getReadListener().onAllDataRead();

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

request.getReadListener() != null) {
try {
  if (available()) {

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

request.getReadListener() != null) {
try {
  if (inputBuffer.available() > 0) {

相关文章

Request类方法