Package com.volantis.xml.pipeline.sax.drivers.web

Examples of com.volantis.xml.pipeline.sax.drivers.web.WebDriverAccessor


                    webdConfig.getTimeoutInMillis());
            requestOperation.setTimeout(timeout);

            // This is necessary in order for the request process to be
            // able to pick up the headers, parameters, cookies etc.
            WebDriverAccessor webdAccessor = createWebDriverAccessor(
                    createWebDriverRequest(httpRequest,
                                           marinerRequestContext,
                                           remoteProjectName,
                                           urlRemapper),
                    new WebDriverResponseImpl());
            pipelineContext.setProperty(WebDriverAccessor.class,
                    webdAccessor , false);

            ProxySessionIdOperationProcess proxySessionOperationProcess =
                    new ProxySessionIdOperationProcess();

            XMLProcess urlRewriterProcess =
                    createURLRewriterProcess(httpRequest.getContextPath(),
                                             urlRemapper);

            // Add them to the pipeline, which will start the processes.
            if (transformURL != null) {
                AttributesImpl atts = new AttributesImpl();
                atts.addAttribute("", "href", "href", "string", transformURL);

                pipeline.getPipelineProcess().startElement(Namespace.PIPELINE.getURI(),
                                                       "transform",
                                                       "transform",
                                                       atts);
            }
            pipeline.addHeadProcess(urlRewriterProcess);
            pipeline.addHeadProcess(proxySessionOperationProcess);
            pipeline.addHeadProcess(requestOperation);

            // Removing them from the pipeline will stop the processes.
            pipeline.removeHeadProcess();
            pipeline.removeHeadProcess();
            pipeline.removeHeadProcess();
            if (transformURL != null) {
                pipeline.getPipelineProcess().endElement(Namespace.PIPELINE.getURI(),
                                                       "transform",
                                                       "transform");
            }

            // FLush and close the stream.
            outputStream.flush();
            outputStream.close();

            // Do this so that the pipeline is in a balanced state, despite
            // the fact that AT THE MOMENT no one else using this pipeline.
            pipelineContext.popBaseURI();

            WebDriverResponse webdResponse =
                webdAccessor.getResponse(pipelineContext, null );


            if (! webdResponse.getContentType().equals("x-application/vnd.xdime+xml")) {
                  throw new RuntimeException(EXCEPTION_LOCALIZER.format(
                    "remote-resource-with-incorrect-contenttype", new Object[]{
View Full Code Here


     */
    protected WebDriverAccessor createWebDriverAccessor(
            final WebDriverRequest request,
            final WebDriverResponse response) {

        return new WebDriverAccessor() {
            public WebDriverRequest getRequest(
                    XMLPipelineContext pipelineContext) {
                return request;
            }

View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.drivers.web.WebDriverAccessor

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.