Package com.volantis.xml.pipeline.sax

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


    }

    // Javadoc inherited.
    public void play(XMLProcess process) throws SAXException {

        XMLPipeline pipeline = process.getPipeline();

        ContextManagerProcess cup = new ContextManagerProcess();
        cup.setPipeline(pipeline);

        cup.setNextProcess(process);
        cup.startProcess();

        XMLPipelineContext context = pipeline.getPipelineContext();
        Locator playLocator = player.getLocator();
        context.pushLocator(playLocator);
        manager = context.getFlowControlManager();
        try {
            player.setContentHandler(cup);
View Full Code Here


        if (!dynamicProcess.getPipelineContext().inErrorRecoveryMode()) {

            // The bindings have finished.
            model.endBindings();

            XMLPipeline pipeline = dynamicProcess.getPipeline();

            // In order to get the required template definition to be processed
            // we need to invoke a URI inclusion based on the given href.
            Fetcher fetcher = new Fetcher(pipeline);
            fetcher.setHref(href);
View Full Code Here

     * @param process The process to which the contents are to be streamed.
     */
    private void streamContents(XMLProcess process)
            throws SAXException {

        XMLPipeline pipeline;

        if (value.requiresDynamicPipeline()) {
            // The value requires an external dynamic pipeline so create one.
            pipeline = pipelineFactory.createDynamicPipeline(context);
        } else {
            // The value has already been processed, so we don't need a
            // dynamic pipeline.
            pipeline = pipelineFactory.createPipeline(context);
        }

        pipeline.addTailProcess(process);

        value.insert(pipeline, parameter);
    }
View Full Code Here

                               Attributes attributes)
            throws SAXException {
        // factor the adapter that should be added to the pipeline
        AdapterProcess process = createAdapterProcess(dynamicProcess);
        if (process != null) {
            XMLPipeline pipeline = dynamicProcess.getPipeline();
            if (pipeline instanceof XMLPipelineProcessImpl) {
                // pass the details of the element to the process
                process.setElementDetails(element.getNamespaceURI(),
                                          element.getLocalName(),
                                          calculateQName(dynamicProcess,
                                                         element));

                // add the AdapterProcess to the pipeline.
                ((XMLPipelineProcessImpl)pipeline).addHeadProcess(process,
                                                                  attributes);

            } else {
                // Need the pipeline to be an instance of
                // XMLPipelineProcessImpl but wasn't. Deliver a fatal error
                // down the pipeline.
                XMLPipelineContext context = pipeline.getPipelineContext();
                XMLPipelineException error = new XMLPipelineException(
                        "Expected pipeline to be instance of " +
                        "XMLPipelineProcessImpl, but was " +
                        pipeline.getClass(),
                        context.getCurrentLocator());
                // send the error down the pipeline
                pipeline.getPipelineProcess().fatalError(error);
            }
        }
        // return the process that was added
        return process;
    }
View Full Code Here

        final DependencyContextMock dependencyContextMock =
            new DependencyContextMock("dependencyContextMock", expectations);
        pipelineContextMock =
            new XMLPipelineContextMock("pipelineContextMock", expectations);
        final XMLPipeline pipeline =
            new XMLPipelineProcessImpl(pipelineContextMock);

        final CacheProcessConfiguration cacheProcessConfig =
            new CacheProcessConfiguration();
        cacheProcessConfig.createCache("cacheName", "100", "50");
View Full Code Here

        // If the configuration has the the 'responseContainsPipelineMarkup'
        // flag set, then we need to create a pipeline and insert it before
        // the next process (which could be the URLRewriteProcess or next
        if (configuration.getResponseContainsPipelineMarkup()) {
            XMLPipeline pipeline = getPipelineContext().getPipelineFactory().
                    createDynamicPipeline(getPipelineContext());
            XMLProcess pipelineProcess = pipeline.getPipelineProcess();
            pipelineProcess.setNextProcess(nextProcess);
            nextProcess = pipelineProcess;
        }

        if (redirectURL != null) {
View Full Code Here

    // Javadoc inherited.
    protected XMLProcess createProcess(
            DynamicProcess dynamicProcess, ExpandedName elementName,
            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();
View Full Code Here

        XMLPipelineContext context = factory.createPipelineContext(
                    pipelineConfiguration,
                    interaction);

        // create a pipeline
        XMLPipeline pipeline = factory.createDynamicPipeline(context);
       
        // create a dynamic process
        dynamicProcess = factory.createDynamicProcess(
                new SimpleDynamicProcessConfiguration());
               
View Full Code Here

        // create an expanded name       
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");
        Attributes atts = new AttributesImpl();       
       
        XMLPipeline pipeline = dynamicProcess.getPipeline();       
       
        NamespacePrefixTracker tracker =
                pipeline.getPipelineContext().getNamespacePrefixTracker();
       
        // register the prefix with the tracker
        tracker.startPrefixMapping("p", "testNamespace");
           
        // invoke startElement on the rule
        Object returned = rule.startElement(dynamicProcess, eName, atts);    
       
        // ensure the process was added to the pipeline
        assertSame("Adapter Process was not added to the pipeline",
                   adapterProcess, pipeline.getHeadProcess());
       
        // ensure the object return was the addapter process
        assertSame("startElement should return the adapter process that was " +
                   "added to the pipeline", adapterProcess, returned);
       
View Full Code Here

     * Tests the {@link AbstractAddAdapterRule#endElement} method
     * @throws Exception if an error occurs
     */
    public void testEndElement() throws Exception {
        // retrieve the pipeline
        XMLPipeline pipeline = dynamicProcess.getPipeline();
        // add a process to the head of the pipeline       
        pipeline.addHeadProcess(adapterProcess);
           
        ExpandedName eName = new ImmutableExpandedName("testNamespace",
                                                       "testLocalName");
   
        // call end element on the rule
        rule.endElement(dynamicProcess, eName, adapterProcess);
       
        // ensure that the process was removed from the pipeline
        assertNotSame("endElement did not remove the adapter process from " +
                      "the pipeline",
                      adapterProcess,
                      pipeline.getHeadProcess());
               
    }
View Full Code Here

TOP

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

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.