Package com.volantis.xml.pipeline.sax.recorder

Examples of com.volantis.xml.pipeline.sax.recorder.PipelinePlayer


            // Propagate the dependencies upwards.
            dependencyContext.propagateDependencies();

            // Play the content back.
            PipelineRecording recording = recorder.stopRecording();
            PipelinePlayer player = recording.createPlayer();
            player.play(getNextProcess());

            // Remove the recovery point and keep the changes that have been
            // made to the pipeline context.
            context.removeRecoveryPoint(recoveryPoint, true);
View Full Code Here


            // This will cause the original event recorder to send the
            // original SAX events to the target pipeline which will
            // then preprocess them (we assume) and send them to the
            // event collection process
            try {
                PipelinePlayer player = recording.createPlayer();
                player.play(target.getPipelineProcess());
                recording = processedEventRecorder.stopRecording();
            } finally {
                // Must always remove the collection process so that the
                // pipeline isn't messed up
                target.removeHeadProcess();
            }

            evaluationMode = EvaluationMode.IMMEDIATE;
        }

        // Verify that the event recorder contains compatible markup
        if (complexity != Complexity.COMPLEX) {
            if (evaluationMode == EvaluationMode.REPEATED) {
                // Add a process that will only allow characters and ignorable
                // whitespace events through to perform the complexity testing
                addComplexityChecker(target, parameter);
            } else if (recording.isComplex()) {
                throw new XMLPipelineException("The " + parameter +
                        " value's type is simple but complex markup " +
                        "has been found", null);
            }
        }

        try {
            // Add the dependency information for this value to the pipeline.
            DependencyContext dependencyContext =
                    context.getDependencyContext();
            dependencyContext.addDependency(dependency);

            XMLProcess process;

            // Select the process to which the content should be sent based
            // on whether it needs to be processed through the dynamic pipeline
            // or not.
            if (evaluationMode == EvaluationMode.REPEATED) {
                // The evaluation mode is repeated so each time the content
                // is played back it needs to be processed through the dynamic
                // process which is accessed through the pipeline process.
                process = target.getPipelineProcess();
            } else {
                // The content has already been processed so send it to the
                // process after the dynamic process. That is either the
                // head process, or if that is null the next process.
                process = target.getHeadProcess();
                if (process == null) {
                    process = target.getPipelineProcess().getNextProcess();
                }
            }

            PipelinePlayer player = recording.createPlayer();
            player.play(process);
        } finally {
            if (complexity != Complexity.COMPLEX &&
                    evaluationMode == EvaluationMode.REPEATED) {
                // Remove the temporary process added above (this was added for
                // complexity testing purposes)
View Full Code Here

                dynamicProcess.getPipeline().getPipelineContext();
        InternalExpressionContext expressionContext =
                (InternalExpressionContext)
                pipelineContext.getExpressionContext();

        PipelinePlayer player = recording.createPlayer();

        // Push a new scope to contain the variable and shadow any variable
        // with the same name.
        expressionContext.pushBlockScope();

        // Push a new position scope to track the iteration position
        expressionContext.pushPositionScope();
        PositionScope pc = expressionContext.getPositionScope();

        // Declare an unitialized variable.
        InternalExpressionScope scope = (InternalExpressionScope)
                expressionContext.getCurrentScope();
        Variable variable = scope.declareVariable(variableName);

        // Iterate over the sequence.
        int length = sequence.getLength();

        for (int i = 1; i <= length; i += 1) {
            // Increment to the next position in the sequence
            pc.increment();

            // Get the item.
            try {
                variable.setValue(sequence.getItem(i));
            } catch (SequenceIndexOutOfBoundsException e) {
                throw new ExtendedSAXException(e);
            }

            // Replay the events through the dynamic process.
            player.play(dynamicProcess);
        }

        // Make sure to pop the scope for tracking position the one that
        // contains the variable.
        expressionContext.popPositionScope();
View Full Code Here

                    " with key " +
                    cacheKey +
                    " playback started");
        }

        PipelinePlayer player = recording.createPlayer();
        player.play(getNextProcess());

        if (logger.isDebugEnabled()) {
            logger.debug("Cache entry in " +
                    cacheName +
                    " with key " +
View Full Code Here

        XMLPipelineFilter mcsFilter = factory.createPipelineFilter(pipeline);

        mcsFilter.setContentHandler(mcsContentHandler);

        // Replay the SAX events into the pipeline.
        PipelinePlayer player = recording.createPlayer();
        player.play(pipeline.getPipelineProcess());
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.recorder.PipelinePlayer

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.