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

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


        while (true) {
            int event = reader.getEventType();
            if (event == XMLStreamConstants.START_ELEMENT) {
                if ("policySet".equals(reader.getName().getLocalPart())) {
                    reader.nextTag();
                    StAXArtifactProcessor processor = processors.get(reader.getName());
                    Object xxx = processor.read(reader, context);
//                    Policy policy = (Policy)processor.read(reader);

                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                    XMLStreamWriter writer = outputFactory.createXMLStreamWriter(outputStream);
                    processor.write(xxx, writer, context);
//                    processor.write(policy, writer);
                    writer.flush();
                    results.add(outputStream.toString());
                }
            }
View Full Code Here


        for (final BindingActivator bindingActivator : bindingActivators) {

            // Remove the binding SCDL processor from the runtime
            if (staxProcessors != null) {
                StAXArtifactProcessor processor = staxProcessors.getProcessor(getBindingQName(bindingActivator.getBindingClass()));
                if (processor != null) {
                    staxProcessors.removeArtifactProcessor(processor);
                }
            }
View Full Code Here

    public void stop(ExtensionPointRegistry registry) {
        StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);

        for (final ImplementationActivator implementationActivator : implementationActivators) {
            if (staxProcessors != null) {
                StAXArtifactProcessor processor = staxProcessors.getProcessor(getSCDLQName(implementationActivator.getImplementationClass()));
                if (processor != null) {
                    staxProcessors.removeArtifactProcessor(processor);
                }
            }
        }
View Full Code Here

        for (final BindingActivator bindingActivator : bindingActivators) {

            // Remove the binding SCDL processor from the runtime
            if (staxProcessors != null) {
                StAXArtifactProcessor processor =
                    staxProcessors.getProcessor(getBindingQName(bindingActivator.getBindingClass()));
                if (processor != null) {
                    staxProcessors.removeArtifactProcessor(processor);
                }
            }
View Full Code Here

    public void stop(ExtensionPointRegistry registry) {
        StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);

        for (final ImplementationActivator implementationActivator : implementationActivators) {
            if (staxProcessors != null) {
                StAXArtifactProcessor processor = staxProcessors.getProcessor(getSCDLQName(implementationActivator.getImplementationClass()));
                if (processor != null) {
                    staxProcessors.removeArtifactProcessor(processor);
                }
            }
        }
View Full Code Here

        for (final BindingActivator bindingActivator : bindingActivators) {

            // Remove the binding SCDL processor from the runtime
            if (staxProcessors != null) {
                StAXArtifactProcessor processor =
                    staxProcessors.getProcessor(getBindingQName(bindingActivator.getBindingClass()));
                if (processor != null) {
                    staxProcessors.removeArtifactProcessor(processor);
                }
            }
View Full Code Here

    public void stop(ExtensionPointRegistry registry) {
        StAXArtifactProcessorExtensionPoint staxProcessors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);

        for (final ImplementationActivator implementationActivator : implementationActivators) {
            if (staxProcessors != null) {
                StAXArtifactProcessor processor = staxProcessors.getProcessor(getSCDLQName(implementationActivator.getImplementationClass()));
                if (processor != null) {
                    staxProcessors.removeArtifactProcessor(processor);
                }
            }
        }
View Full Code Here

        while (true) {
            int event = reader.getEventType();
            if (event == XMLStreamConstants.START_ELEMENT) {
                if ("policySet".equals(reader.getName().getLocalPart())) {
                    reader.nextTag();
                    StAXArtifactProcessor processor = processors.get(reader.getName());
                    Policy policy = (Policy)processor.read(reader);

                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                    XMLStreamWriter writer = outputFactory.createXMLStreamWriter(outputStream);
                    processor.write(policy, writer);
                    writer.flush();
                    results.add(outputStream.toString());
                }
            }
            if (reader.hasNext()) {
View Full Code Here

        }
        return defaultMappedBinding;
    }

    private BindingBuilder getBindingBuilder(QName binding) {
        StAXArtifactProcessor processor = processors.getProcessor(binding);
        if (processor == null) {
            logger.warning("Mapped binding for binding.sca is not supported: " + binding);
        }

        try {
View Full Code Here

        StAXAttributeProcessorExtensionPoint attributeExtensionPoint = registry.getExtensionPoint(StAXAttributeProcessorExtensionPoint.class);
        StAXAttributeProcessor<Object> extensibleStAXAttributeProcessor = new ExtensibleStAXAttributeProcessor(attributeExtensionPoint, inputFactory, outputFactory);
       
        BuilderExtensionPoint builderExtensionPoint = registry.getExtensionPoint(BuilderExtensionPoint.class);
       
        StAXArtifactProcessor processor = artifactExtensionPoint.getProcessor(Definitions.class);
       
        Object artifact = null;
       
        // Read the first definitions string
       
        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(WS_POLICY1));
       
        artifact = processor.read(reader, new ProcessorContext());
        assertNotNull(artifact);
        Assert.assertTrue(artifact instanceof Definitions);
        Definitions definitions1 = (Definitions) artifact;

        // Read the second definitions string
       
        reader = inputFactory.createXMLStreamReader(new StringReader(WS_POLICY2));

        artifact = processor.read(reader, new ProcessorContext());
        assertNotNull(artifact);
        Assert.assertTrue(artifact instanceof Definitions);
        Definitions definitions2 = (Definitions) artifact; 
       
        // compare the policies using the policy builder
View Full Code Here

TOP

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

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.