org.apache.catalina.connector.Request.getCoyoteRequest()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(302)

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

Request.getCoyoteRequest介绍

[英]Get the Coyote request.
[中]

代码示例

代码示例来源:origin: spring-projects/spring-framework

private static HttpHeaders createTomcatHttpHeaders(HttpServletRequest request) {
  RequestFacade requestFacade = getRequestFacade(request);
  org.apache.catalina.connector.Request connectorRequest = (org.apache.catalina.connector.Request)
      ReflectionUtils.getField(COYOTE_REQUEST_FIELD, requestFacade);
  Assert.state(connectorRequest != null, "No Tomcat connector request");
  Request tomcatRequest = connectorRequest.getCoyoteRequest();
  TomcatHeadersAdapter headers = new TomcatHeadersAdapter(tomcatRequest.getMimeHeaders());
  return new HttpHeaders(headers);
}

代码示例来源:origin: org.springframework/spring-web

private static HttpHeaders createTomcatHttpHeaders(HttpServletRequest request) {
  RequestFacade requestFacade = getRequestFacade(request);
  org.apache.catalina.connector.Request connectorRequest = (org.apache.catalina.connector.Request)
      ReflectionUtils.getField(COYOTE_REQUEST_FIELD, requestFacade);
  Assert.state(connectorRequest != null, "No Tomcat connector request");
  Request tomcatRequest = connectorRequest.getCoyoteRequest();
  TomcatHeadersAdapter headers = new TomcatHeadersAdapter(tomcatRequest.getMimeHeaders());
  return new HttpHeaders(headers);
}

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

public boolean isStarted() {
  AtomicBoolean result = new AtomicBoolean(false);
  request.getCoyoteRequest().action(
      ActionCode.ASYNC_IS_STARTED, result);
  return result.get();
}

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

@Override
  public void addElement(StringBuilder buf, Date date, Request request,
      Response response, long time) {
    RequestInfo info = request.getCoyoteRequest().getRequestProcessor();
    if(info != null) {
      buf.append(info.getWorkerThreadName());
    } else {
      buf.append("-");
    }
  }
}

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

@Override
public void setTimeout(long timeout) {
  check();
  this.timeout = timeout;
  request.getCoyoteRequest().action(ActionCode.ASYNC_SETTIMEOUT,
      Long.valueOf(timeout));
}

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

@Override
  public void run() {
    request.getCoyoteRequest().action(ActionCode.ASYNC_DISPATCHED, null);
    try {
      applicationDispatcher.dispatch(servletRequest, servletResponse);
    }catch (Exception x) {
      //log.error("Async.dispatch",x);
      throw new RuntimeException(x);
    }
  }
};

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

@Override
public void setTimeout(long timeout) {
  check();
  this.timeout = timeout;
  request.getCoyoteRequest().action(ActionCode.ASYNC_SETTIMEOUT,
      Long.valueOf(timeout));
}

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

private void setContentType(final Request request, final RewriteRule rule) {
  if (request.getCoyoteRequest().contentType() == null) {
    request.getCoyoteRequest().setContentType(MessageBytes.newInstance());
  }
  request.getCoyoteRequest().setContentType(rule.getTypeValue());
}

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

protected void recycleCookieInfo(boolean recycleCoyote) {
  cookiesParsed = false;
  cookiesConverted = false;
  cookies = null;
  if (recycleCoyote) {
    getCoyoteRequest().getCookies().recycle();
  }
}

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

@Override
public Object get(Request request, String name) {
  if (request.getCoyoteRequest().getParameters()
      .isParseFailed()) {
    return Boolean.TRUE;
  }
  return null;
}

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

@Override
public void run() {
  request.getCoyoteRequest().action(ActionCode.ASYNC_DISPATCHED, null);
  try {
    applicationDispatcher.dispatch(servletRequest, servletResponse);
  } catch (Exception e) {
    throw new RuntimeException(sm.getString("asyncContextImpl.asyncDispachError"), e);
  }
}

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

@Override
public void start(final Runnable run) {
  if (log.isDebugEnabled()) {
    logDebug("start      ");
  }
  check();
  Runnable wrapper = new RunnableWrapper(run, context, this.request.getCoyoteRequest());
  this.request.getCoyoteRequest().action(ActionCode.ASYNC_RUN, wrapper);
}

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

@Override
public void start(final Runnable run) {
  if (log.isDebugEnabled()) {
    logDebug("start      ");
  }
  check();
  Runnable wrapper = new RunnableWrapper(run, context, this.request.getCoyoteRequest());
  this.request.getCoyoteRequest().action(ActionCode.ASYNC_RUN, wrapper);
}

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

@Override
public Object get(Request request, String name) {
  return Boolean.valueOf(
      request.getConnector().getProtocolHandler(
          ).isSendfileSupported() && request.getCoyoteRequest().getSendfile());
}
@Override

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

@Override
public void complete() {
  if (log.isDebugEnabled()) {
    logDebug("complete   ");
  }
  check();
  request.getCoyoteRequest().action(ActionCode.COMMIT, null);
  request.getCoyoteRequest().action(ActionCode.ASYNC_COMPLETE, null);
  clearServletRequestResponse();
}

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

@Override
  public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) {
    long commitTime = response.getCoyoteResponse().getCommitTime();
    if (commitTime == -1) {
      buf.append('-');
    } else {
      long delta = commitTime - request.getCoyoteRequest().getStartTime();
      buf.append(Long.toString(delta));
    }
  }
}

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

@Override
  public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) {
    long commitTime = response.getCoyoteResponse().getCommitTime();
    if (commitTime == -1) {
      buf.append('-');
    } else {
      long delta = commitTime - request.getCoyoteRequest().getStartTime();
      buf.append(Long.toString(delta));
    }
  }
}

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

@Override
  public void addElement(CharArrayWriter buf, Date date, Request request,
      Response response, long time) {
    RequestInfo info = request.getCoyoteRequest().getRequestProcessor();
    if(info != null) {
      buf.append(info.getWorkerThreadName());
    } else {
      buf.append("-");
    }
  }
}

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

@Override
public void complete() {
  if (log.isDebugEnabled()) {
    logDebug("complete   ");
  }
  check();
  request.getCoyoteRequest().action(ActionCode.ASYNC_COMPLETE, null);
}

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

@Override
  public void addElement(CharArrayWriter buf, Date date, Request request,
      Response response, long time) {
    RequestInfo info = request.getCoyoteRequest().getRequestProcessor();
    if(info != null) {
      buf.append(info.getWorkerThreadName());
    } else {
      buf.append("-");
    }
  }
}

相关文章

Request类方法