org.apache.catalina.Pipeline.invoke()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(124)

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

Pipeline.invoke介绍

[英]Cause the specified request and response to be processed by the Valves associated with this pipeline, until one of these valves causes the response to be created and returned. The implementation must ensure that multiple simultaneous requests (on different threads) can be processed through the same Pipeline without interfering with each other's control flow.
[中]

代码示例

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * Process the specified Request, to produce the corresponding Response,
 * by invoking the first Valve in our pipeline (if any), or the basic
 * Valve otherwise.
 *
 * @param request Request to be processed
 * @param response Response to be produced
 *
 * @exception IllegalStateException if neither a pipeline or a basic
 *  Valve have been configured for this Container
 * @exception IOException if an input/output error occurred while
 *  processing
 * @exception ServletException if a ServletException was thrown
 *  while processing this request
 */
public void invoke(Request request, Response response)
  throws IOException, ServletException {
  pipeline.invoke(request, response);
}

代码示例来源:origin: org.glassfish.web/web-glue

/**
 * Processes the specified request, and produces the appropriate
 * response, by invoking the first valve (if any) of this pipeline, or
 * the pipeline's basic valve.
 *
 * If the request path to process identifies an ad-hoc path, the
 * web module's ad-hoc pipeline is invoked.
 *
 * @param request The request to process
 * @param response The response to return
 */
public void invoke(Request request, Response response)
    throws IOException, ServletException {
  HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
  if (webModule != null &&
      webModule.getAdHocServletName(hreq.getServletPath()) != null) {
    webModule.getAdHocPipeline().invoke(request, response);
  } else {
    RealmAdapter realmAdapter = (RealmAdapter)webModule.getRealm();
    if (realmAdapter != null &&
        realmAdapter.isSecurityExtensionEnabled()){
      super.doChainInvoke(request, response);
    } else {
      super.invoke(request, response);
    }
  }
}

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * Tomcat style invocation.
 */
@Override
public void invoke(org.apache.catalina.connector.Request request,
          org.apache.catalina.connector.Response response)
    throws IOException, ServletException {
  Host host = preInvoke(request, response);
  if (host == null) {
    return;
  }
  if (host.getPipeline().hasNonBasicValves() ||
      host.hasCustomPipeline()) {
    // Invoke pipeline
    host.getPipeline().invoke(request, response);
  } else {
    // Invoke basic valve only
    host.getPipeline().getBasic().invoke(request, response);
  }
}

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * Tomcat style invocation.
 */
@Override
public void invoke(org.apache.catalina.connector.Request request,
          org.apache.catalina.connector.Response response)
    throws IOException, ServletException {
  Context context = preInvoke(request, response);
  if (context == null) {
    return;
  }
  // Ask this Context to process this request
  if (context.getPipeline().hasNonBasicValves() ||
      context.hasCustomPipeline()) {
    context.getPipeline().invoke(request, response);
  } else {
    context.getPipeline().getBasic().invoke(request, response);
  }
  postInvoke(request, response);
}

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * Select the appropriate child Context to process this request,
 * based on the specified request URI.  If no matching Context can
 * be found, return an appropriate HTTP error.
 *
 * @param request Request to be processed
 * @param response Response to be produced
 *
 * @exception IOException if an input/output error occurred
 * @exception ServletException if a servlet error occurred
 */
@Override
public int invoke(Request request, Response response)
    throws IOException, ServletException {
  Context context = preInvoke(request, response);
  if (context == null) {
    return END_PIPELINE;
  }
  // Ask this Context to process this request
  if (context.getPipeline().hasNonBasicValves() ||
      context.hasCustomPipeline()) {
    context.getPipeline().invoke(request, response);
  } else {
    context.getPipeline().getBasic().invoke(request, response);
  }
  return END_PIPELINE;
}

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * Select the appropriate child Host to process this request,
 * based on the requested server name.  If no matching Host can
 * be found, return an appropriate HTTP error.
 *
 * @param request Request to be processed
 * @param response Response to be produced
 * @param valveContext Valve context used to forward to the next Valve
 *
 * @exception IOException if an input/output error occurred
 * @exception ServletException if a servlet error occurred
 */
@Override
public int invoke(Request request, Response response)
    throws IOException, ServletException {
  Host host = preInvoke(request, response);
  if (host == null) {
    return END_PIPELINE;
  }
  if (host.getPipeline().hasNonBasicValves() ||
      host.hasCustomPipeline()) {
    // Invoke pipeline
    host.getPipeline().invoke(request, response);
  } else {
    // Invoke basic valve only
    host.getPipeline().getBasic().invoke(request, response);
  }
  return END_PIPELINE;
}

代码示例来源:origin: org.glassfish.main.web/web-core

/**
 * Tomcat style invocation.
 */
@Override
public void invoke(org.apache.catalina.connector.Request request,
          org.apache.catalina.connector.Response response)
    throws IOException, ServletException {
  Wrapper wrapper = preInvoke(request, response);
  if (wrapper == null) {
    return;
  }
  /* GlassFish 1343
  wrapper.getPipeline().invoke(request, response);
  */
  // START GlassFish 1343
  if (wrapper.getPipeline().hasNonBasicValves() ||
      wrapper.hasCustomPipeline()) {
    wrapper.getPipeline().invoke(request, response);
  } else {
    GlassFishValve basic = wrapper.getPipeline().getBasic();
    if (basic != null) {
      basic.invoke(request, response);
      basic.postInvoke(request, response);
    }
  }
  // END GlassFish 1343
  postInvoke(request, response);
}

代码示例来源:origin: org.glassfish.main.web/web-core

wrapper.getPipeline().invoke(request, response);
} else {
  GlassFishValve basic = wrapper.getPipeline().getBasic();

代码示例来源:origin: org.glassfish.main.web/web-core

if (container.getPipeline().hasNonBasicValves() ||
    container.hasCustomPipeline()) {
  container.getPipeline().invoke(request, response);
} else {
    host.getPipeline().invoke(request, response);
  } else {
    GlassFishValve hostValve = host.getPipeline().getBasic();

相关文章