Package org.apache.catalina

Examples of org.apache.catalina.Request


            // each valve's processing logic and then move onto to the
            // next valve in the pipeline only if the previous valve indicated
            // that the pipeline should proceed.
            int i;
            for (i = 0; i < valves.length; i++) {
                Request req = request;
                Response resp = response;
                if (chaining) {
                    req = getRequest(request);
                    resp = getResponse(request, response);
                }
                status = valves[i].invoke(req, resp);
                if (status != GlassFishValve.INVOKE_NEXT)
                    break;
            }

            // Save a reference to the valve[], to ensure that postInvoke()
            // is invoked on the original valve[], in case a valve gets added
            // or removed during the invocation of the basic valve (e.g.,
            // in case access logging is enabled or disabled by some kind of
            // admin servlet), in which case the indices used for postInvoke
            // invocations below would be off
            GlassFishValve[] savedValves = valves;

            // Invoke the basic valve's request processing and post-request
            // logic only if the pipeline was not aborted (i.e. no valve
            // returned END_PIPELINE).
            // In addition, the basic valve needs to be invoked by the
            // pipeline only if no Tomcat-style valves have been added.
            // Otherwise, it will be invoked by the last Tomcat-style valve
            // directly.
            if (status == GlassFishValve.INVOKE_NEXT) {
                if (firstTcValve != null) {
                    firstTcValve.invoke(
                        (org.apache.catalina.connector.Request) request,
                        (org.apache.catalina.connector.Response) response);
                } else if (basic != null) {
                    Request req = request;
                    Response resp = response;
                    if (chaining) {
                        req = getRequest(request);
                        resp = getResponse(request, response);
                    }
                    basic.invoke(req, resp);
                    basic.postInvoke(req, resp);
                }
            }

            // Invoke the post-request processing logic only on those valves
            // that returned a status of INVOKE_NEXT
            for (int j = i - 1; j >= 0; j--) {
                Request req = request;
                Response resp = response;
                if (chaining) {
                    req = getRequest(request);
                    resp = getResponse(request, response);
                }

                savedValves[j].postInvoke(req, resp);
            }

            savedValves = null;

        } else {
            throw new ServletException
                    (rb.getString(NO_VALVES_IN_PIPELINE_EXCEPTION));
        }

        // Calls the protocol handler's init method if the request is marked to be upgraded
        if (request instanceof org.apache.catalina.connector.Request) {
            org.apache.catalina.connector.Request req = (org.apache.catalina.connector.Request) request;
            if (req.isUpgrade()) {
                ProtocolHandler handler = req.getProtocolHandler();
                if (handler != null) {
                    handler.init(
                            new WebConnectionImpl(
                            req.getInputStream(),
                            ((org.apache.catalina.connector.Response)req.getResponse()).getOutputStream()));
                } else {
                    log.log(Level.SEVERE, PROTOCOL_HANDLER_REQUIRED_EXCEPTION);
                }
            }
        }
View Full Code Here


        }
    }


    private Request getRequest(Request request) {
  Request r = (Request)
      request.getNote(Globals.WRAPPED_REQUEST);
  if (r == null) {
      r = request;
  }
  return r;
View Full Code Here

            // each valve's processing logic and then move onto to the
            // next valve in the pipeline only if the previous valve indicated
            // that the pipeline should proceed.
            int i;
            for (i = 0; i < valves.length; i++) {
                Request req = request;
                Response resp = response;
                if (chaining) {
                    req = getRequest(request);
                    resp = getResponse(request, response);
                }
                status = valves[i].invoke(req, resp);
                if (status != GlassFishValve.INVOKE_NEXT)
                    break;
            }

            // Save a reference to the valve[], to ensure that postInvoke()
            // is invoked on the original valve[], in case a valve gets added
            // or removed during the invocation of the basic valve (e.g.,
            // in case access logging is enabled or disabled by some kind of
            // admin servlet), in which case the indices used for postInvoke
            // invocations below would be off
            GlassFishValve[] savedValves = valves;

            // Invoke the basic valve's request processing and post-request
            // logic only if the pipeline was not aborted (i.e. no valve
            // returned END_PIPELINE).
            // In addition, the basic valve needs to be invoked by the
            // pipeline only if no Tomcat-style valves have been added.
            // Otherwise, it will be invoked by the last Tomcat-style valve
            // directly.
            if (status == GlassFishValve.INVOKE_NEXT) {
                if (firstTcValve != null) {
                    firstTcValve.invoke(
                        (org.apache.catalina.connector.Request) request,
                        (org.apache.catalina.connector.Response) response);
                } else if (basic != null) {
                    Request req = request;
                    Response resp = response;
                    if (chaining) {
                        req = getRequest(request);
                        resp = getResponse(request, response);
                    }
                    basic.invoke(req, resp);
                    basic.postInvoke(req, resp);
                }
            }

            // Invoke the post-request processing logic only on those valves
            // that returned a status of INVOKE_NEXT
            for (int j = i - 1; j >= 0; j--) {
                Request req = request;
                Response resp = response;
                if (chaining) {
                    req = getRequest(request);
                    resp = getResponse(request, response);
                }

                savedValves[j].postInvoke(req, resp);
            }

            savedValves = null;

        } else {
            throw new ServletException
                    (rb.getString(NO_VALVES_IN_PIPELINE_EXCEPTION));
        }

        // Calls the protocol handler's init method if the request is marked to be upgraded
        if (request instanceof org.apache.catalina.connector.Request) {
            org.apache.catalina.connector.Request req = (org.apache.catalina.connector.Request) request;
            if (req.isUpgrade()) {
                HttpUpgradeHandler handler = req.getHttpUpgradeHandler();
                if (handler != null) {
                    WebConnectionImpl wc =
                            new WebConnectionImpl(
                                    req.getInputStream(),
                                    ((org.apache.catalina.connector.Response)req.getResponse()).getOutputStream());
                    wc.setRequest(req);
                    if (response instanceof org.apache.catalina.connector.Response) {
                        wc.setResponse((org.apache.catalina.connector.Response) response);
                    }
                    handler.init(wc);
View Full Code Here

        }
    }


    private Request getRequest(Request request) {
  Request r = (Request)
      request.getNote(Globals.WRAPPED_REQUEST);
  if (r == null) {
      r = request;
  }
  return r;
View Full Code Here

            return (null);

        // Create and initialize a filter chain object
        ApplicationFilterChain filterChain = null;
        if ((securityManager == null) && (request instanceof Request)) {
            Request req = (Request) request;
            filterChain = (ApplicationFilterChain) req.getFilterChain();
            if (filterChain == null) {
                filterChain = new ApplicationFilterChain();
                req.setFilterChain(filterChain);
            }
        } else {
            // Security: Do not recycle
            // Cannot recycle when under a request dispatcher
            filterChain = new ApplicationFilterChain();
View Full Code Here

            return (null);

        // Create and initialize a filter chain object
        ApplicationFilterChain filterChain = null;
        if ((securityManager == null) && (request instanceof Request)) {
            Request req = (Request) request;
            filterChain = (ApplicationFilterChain) req.getFilterChain();
            if (filterChain == null) {
                filterChain = new ApplicationFilterChain();
                req.setFilterChain(filterChain);
            }
        } else {
            // Security: Do not recycle
            filterChain = new ApplicationFilterChain();
        }
View Full Code Here

    public void invoke(Request request, Response response,
                       ValveContext context)
        throws IOException, ServletException {

        // Identify the underlying request if this request was wrapped
        Request actual = request;
        while (actual instanceof RequestWrapper)
            actual = ((RequestWrapper) actual).getWrappedRequest();
        //        if (debug >= 2)
        //            log("Processing request");
View Full Code Here

    public void invoke(Request request, Response response,
                       ValveContext context)
        throws IOException, ServletException {

        // Identify the underlying request if this request was wrapped
        Request actual = request;
        while (actual instanceof RequestWrapper)
            actual = ((RequestWrapper) actual).getWrappedRequest();
        //        if (debug >= 2)
        //            log("Processing request");
View Full Code Here

            // each valve's processing logic and then move onto to the
            // next valve in the pipeline only if the previous valve indicated
            // that the pipeline should proceed.
            int i;
            for (i = 0; i < valves.length; i++) {
                Request req = request;
                Response resp = response;
                if (chaining) {
                    req = getRequest(request);
                    resp = getResponse(request, response);
                }
                status = valves[i].invoke(req, resp);
                if (status != GlassFishValve.INVOKE_NEXT)
                    break;
            }

            // Save a reference to the valve[], to ensure that postInvoke()
            // is invoked on the original valve[], in case a valve gets added
            // or removed during the invocation of the basic valve (e.g.,
            // in case access logging is enabled or disabled by some kind of
            // admin servlet), in which case the indices used for postInvoke
            // invocations below would be off
            GlassFishValve[] savedValves = valves;

            // Invoke the basic valve's request processing and post-request
            // logic only if the pipeline was not aborted (i.e. no valve
            // returned END_PIPELINE).
            // In addition, the basic valve needs to be invoked by the
            // pipeline only if no Tomcat-style valves have been added.
            // Otherwise, it will be invoked by the last Tomcat-style valve
            // directly.
            if (status == GlassFishValve.INVOKE_NEXT) {
                if (firstTcValve != null) {
                    firstTcValve.invoke(
                        (org.apache.catalina.connector.Request) request,
                        (org.apache.catalina.connector.Response) response);
                } else if (basic != null) {
                    Request req = request;
                    Response resp = response;
                    if (chaining) {
                        req = getRequest(request);
                        resp = getResponse(request, response);
                    }
                    basic.invoke(req, resp);
                    basic.postInvoke(req, resp);
                }
            }

            // Invoke the post-request processing logic only on those valves
            // that returned a status of INVOKE_NEXT
            for (int j = i - 1; j >= 0; j--) {
                Request req = request;
                Response resp = response;
                if (chaining) {
                    req = getRequest(request);
                    resp = getResponse(request, response);
                }

                savedValves[j].postInvoke(req, resp);
            }

            savedValves = null;

        } else {
            throw new ServletException
                (sm.getString("standardPipeline.noValve"));
        }

        // Calls the protocol handler's init method if the request is marked to be upgraded
        if (request instanceof org.apache.catalina.connector.Request) {
            org.apache.catalina.connector.Request req = (org.apache.catalina.connector.Request) request;
            if (req.isUpgrade()) {
                ProtocolHandler handler = req.getProtocolHandler();
                if (handler != null) {
                    handler.init(
                            new WebConnectionImpl(
                            req.getInputStream(),
                            ((org.apache.catalina.connector.Response)req.getResponse()).getOutputStream()));
                } else {
                    log.log(Level.SEVERE, sm.getString("standardPipeline.protocolHandler.required"));
                }
            }
        }
View Full Code Here

        }
    }


    private Request getRequest(Request request) {
  Request r = (Request)
      request.getNote(Globals.WRAPPED_REQUEST);
  if (r == null) {
      r = request;
  }
  return r;
View Full Code Here

TOP

Related Classes of org.apache.catalina.Request

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.