Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.XMLPipelineContext


     */
    public void testStopProcessAmazon() throws Exception {
        RequestOperationProcess process =
                (RequestOperationProcess) createTestableProcess();

        XMLPipelineContext context = process.getPipelineContext();

        SAXHandler saxHandler = new SAXHandler();

        XMLProcess next = XMLHelpers.createSAXHandlerProcess(saxHandler);

        process.setNextProcess(next);

        // Setup the operation and message.
        WSDLOperation operation = new WSDLOperation();
        Message message = new Message();
        WSDriverTestHelpers.setupAmazonOperationMessage(operation,
                message, "Douglas Adams");

        context.setProperty(Operation.class, operation, false);
        context.setProperty(Message.class, message, false);

        process.stopProcess();

        Document document = saxHandler.getDocument();

View Full Code Here


    // javadoc inherited
    public void setPipeline(XMLPipeline pipeline) {
        super.setPipeline(pipeline);

        // get hold of the pipeline context
        XMLPipelineContext context = getPipelineContext();

        // get hold of the pipeline configuration
        pipelineConfiguration = context.getPipelineConfiguration();

        configuration = (WebDriverConfiguration) pipelineConfiguration.
                retrieveConfiguration(WebDriverConfiguration.class);
    }
View Full Code Here

                retrieveConfiguration(WebDriverConfiguration.class);
    }

    // javadoc inherited from interface
    public void stopProcess() throws SAXException {
        XMLPipelineContext context = getPipelineContext();
        if (!context.inErrorRecoveryMode()) {

            MonitoringConfiguration monitoringConfiguration =
                    (MonitoringConfiguration) context.getPipelineConfiguration()
                    .retrieveConfiguration(MonitoringConfiguration.class);


            MonitoredTransaction webdTransaction =
                    monitoringConfiguration.getTransaction("webd");

            webdTransaction.start();
            PluggableHTTPManager httpManager =
                    ((WebDriverConfigurationImpl) configuration).
                    getPluggableHTTPManager(protocolString, pipelineConfiguration);
            httpManager.initialize(configuration, timeout);
            try {
                context.pushBaseURI(getUrlString());
                httpManager.sendRequest(createRequestDetails(), context);
                webdTransaction.stop(MonitoredTransaction.SUCCESSFUL, getUrlString());
            } catch (HTTPException e) {
                webdTransaction.stop(MonitoredTransaction.FAILED, getUrlString());
                fatalError(new XMLPipelineException(
                        exceptionLocalizer.format(
                                "http-request-process-failure",
                                urlString),
                        context.getCurrentLocator(),
                        e));
            } catch (RuntimeHttpException e) {
                webdTransaction.stop(MonitoredTransaction.FAILED, getUrlString());
                fatalError(new XMLPipelineException(
                        exceptionLocalizer.format(
                                "http-request-process-failure",
                                urlString),
                        context.getCurrentLocator(),
                        e));
            } catch (MalformedURLException e) {
                webdTransaction.stop(MonitoredTransaction.FAILED, getUrlString());
                fatalError(new XMLPipelineException(
                        "base uri attribute is malformed",
                        context.getCurrentLocator(),
                        e));
            } finally {
                context.popBaseURI();
            }
        }
    }
View Full Code Here

                                    responseStream,
                                    statusCode,
                                    contentType,
                                    contentEncoding);
                } catch (SAXException e) {
                     XMLPipelineContext context = getPipelineContext();
                    // If the pipeline is already handling this error,
                     if (context.inErrorRecoveryMode()) {
                         // Then we assume that there is a containing try operation that
                         // needs help to avoid the pipeline crashing, so we need to
                         // mask the exception. So just continue on and hope the
                         // pipeline error handling will save us. Note that we cannot
                         // re-report it via fatalError or the flow control manager
View Full Code Here

            if (logger.isDebugEnabled()) {
                String message = "Content type is null - ignoring content.";
                logger.debug(message);
            }
        } else {
            XMLPipelineContext context = getPipelineContext();
            Map contents = (Map) context.getProperty(Content.class);
            if (contents != null) {
                Content content = (Content) contents.get(contentType);
                if (content != null) {
                    action = content.getAction();
                } else {
View Full Code Here

     * XMLFilter can be found for this operation and content type then the given
     * then adapt the consumer XMLProcess into an XMLFilter and return this.
     * @param contentType The content type.
     */
    private XMLFilter retrieveResponseFilter(String contentType) {
        XMLPipelineContext context = getPipelineContext();
        Script script = (Script) context.getProperty(Script.class);
        XMLFilter responseFilter = null;
        if (script != null) {
            responseFilter =
                    configuration.retrieveScriptFilter(script.getRef(),
                                                       contentType);
View Full Code Here

     * if there is one.
     * @return The WebDriverRequest associated with this
     * HTTPRequestOperationProcess.
     */
    private WebDriverRequest retrieveWebDriverRequest() {
        XMLPipelineContext context = getPipelineContext();
        WebDriverAccessor accessor =
                (WebDriverAccessor) context.getProperty(WebDriverAccessor.class);
        WebDriverRequest request = null;
        if (accessor == null) {
            if (logger.isDebugEnabled()) {
                logger.debug("No WebDriverAccessor available");
            }
View Full Code Here

     * if there is one.
     * @return The WebDriverResponse associated with this
     * HTTPRequestOperationProcess.
     */
    private WebDriverResponse retrieveWebDriverResponse() {
        XMLPipelineContext context = getPipelineContext();
        WebDriverAccessor accessor =
                (WebDriverAccessor) context.getProperty(WebDriverAccessor.class);
        WebDriverResponse response = null;
        if (accessor == null) {
            if (logger.isDebugEnabled()) {
                logger.debug("No WebDriverAccessor available");
            }
View Full Code Here

        String filePath = "file://" + tempFile.getPath();
        URIResource resourceB = new URIResource(filePath);
       
        TestPipelineFactory factory = new TestPipelineFactory();
       
        final XMLPipelineContext pipelineContext =
                factory.createPipelineContext();
               
       
        WSDLResource testResource = new WSDLResource() {
            // javadoc inherited
View Full Code Here

            Attributes attributes) throws SAXException {

        XMLPipeline pipeline = dynamicProcess.getPipeline();

        // obain the pipeline configuration
        XMLPipelineContext context = pipeline.getPipelineContext();
        XMLPipelineConfiguration configuration =
                context.getPipelineConfiguration();

        // retrieve an XMLPipelineFactory
        XMLPipelineFactory factory = context.getPipelineFactory();

        // Create a DynamicProcess to be added to the pipeline.
        return factory.createDynamicProcess(configuration);
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.XMLPipelineContext

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.