Package org.apache.tuscany.sca.contribution.processor

Examples of org.apache.tuscany.sca.contribution.processor.ProcessorContext


        artifact.setLocation(location.toString());
        artifact.setURI(uri.toString());
        URLArtifactProcessorExtensionPoint artifactProcessors =
            registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
        ExtensibleURLArtifactProcessor processor = new ExtensibleURLArtifactProcessor(artifactProcessors);
        Object model = processor.read(null, uri, location, new ProcessorContext(monitor));
        artifact.setModel(model);
        return artifact;
    }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    public <T> T loadDocument(URI uri, URL location, Monitor monitor) throws ContributionReadException {
        init();
        Object model = artifactProcessor.read(null, uri, location, new ProcessorContext(monitor));
        return (T)model;
    }
View Full Code Here

    public void saveXMLDocument(Object model, Writer writer, Monitor monitor) throws XMLStreamException,
        ContributionWriteException {
        init();
        XMLStreamWriter streamWriter = staxHelper.createXMLStreamWriter(writer);
        staxProcessor.write(model, streamWriter, new ProcessorContext(monitor));
    }
View Full Code Here

    }

    public void saveXMLElement(Object model, XMLStreamWriter writer, Monitor monitor) throws XMLStreamException,
        ContributionWriteException {
        init();
        staxProcessor.write(model, writer, new ProcessorContext(monitor));
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public Object loadXMLElement(XMLStreamReader reader, Monitor monitor) throws ContributionReadException,
        XMLStreamException {
        init();
        return staxProcessor.read(reader, new ProcessorContext(monitor));
    }
View Full Code Here

        }
    }

    public Contribution loadContribution(URI uri, URL location, Monitor monitor) throws ContributionReadException {
        init();
        ProcessorContext context = new ProcessorContext(monitor);
        // Load the contribution
        Contribution contribution = contributionProcessor.read(null, uri, location, context);
        return contribution;
    }
View Full Code Here

        return contribution;
    }

    public ProcessorContext createProcessorContext() {
        init();
        return new ProcessorContext(monitorFactory.createMonitor());
    }
View Full Code Here

       
        UtilityExtensionPoint utilities = nodeFactory.registry.getExtensionPoint(UtilityExtensionPoint.class);
        this.compositeActivator = utilities.getUtility(CompositeActivator.class);
        try {
            Monitor monitor = nodeFactory.monitorFactory.createMonitor();
            ProcessorContext context = new ProcessorContext(monitor);
           
            // Set up the thead context monitor
            Monitor tcm = nodeFactory.monitorFactory.setContextMonitor(monitor);
            try {
                if (contributions == null) {
View Full Code Here

        XMLOutputFactory outputFactory =
            nodeFactory.getExtensionPointRegistry().getExtensionPoint(FactoryExtensionPoint.class)
                .getFactory(XMLOutputFactory.class);
       
        try {
            compositeProcessor.write(composite, outputFactory.createXMLStreamWriter(bos), new ProcessorContext(nodeFactory.registry));
        } catch(Exception ex) {
            return ex.toString();
        }
       
        String result = bos.toString();
View Full Code Here

        SAXException {
        // First write the composite into a DOM document so that we can apply the xpath
        StringWriter sw = new StringWriter();
        XMLStreamWriter writer = staxHelper.createXMLStreamWriter(sw);
        // Write the composite into a DOM document
        processor.write(composite, writer, new ProcessorContext(registry));
        writer.close();

        Document document = domHelper.load(sw.toString());
       
        // Debugging
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.processor.ProcessorContext

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.