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

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


    @Before
    public void setUp() throws Exception {
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        ModelResolverExtensionPoint resolvers = new DefaultModelResolverExtensionPoint(registry);
        resolvers.addResolver(Model.class, TestModelResolver.class);
        context = new ProcessorContext();
        FactoryExtensionPoint factories = new DefaultFactoryExtensionPoint(registry);

        resolver = new ExtensibleModelResolver(null, resolvers, factories);

        factory = new DefaultContributionFactory();
View Full Code Here


        try {
            StAXHelper stAXHelper = StAXHelper.getInstance(extensionPointRegistry);
            StAXArtifactProcessorExtensionPoint staxProcessors = extensionPointRegistry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
            ExtensibleStAXArtifactProcessor staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, null, stAXHelper.getOutputFactory());
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            staxProcessor.write(model, bos, new ProcessorContext(extensionPointRegistry));
            bos.close();

            if (!pretty) {
                return bos.toString();
            }
View Full Code Here

    @Override
    public NodeConfiguration loadConfiguration(InputStream xml, URL base) {
        try {
            init();
            InputStreamReader reader = new InputStreamReader(xml, "UTF-8");
            ProcessorContext context = deployer.createProcessorContext();
            NodeConfiguration config = deployer.loadXMLDocument(reader, context.getMonitor());
            if (base != null && config != null) {
                // Resolve the contribution location against the node.xml
                for (ContributionConfiguration c : config.getContributions()) {
                    String location = c.getLocation();
                    if (location != null) {
View Full Code Here

        this.operation = operation;
        this.wsdlDefinition = wsdlDefinition;
        this.resolver = resolver;
        this.dataBinding = dataBinding;
        this.wrapper = new Wrapper();
        this.context = new ProcessorContext(monitor);
    }
View Full Code Here

        nodeFactory.addNode(configuration, this);
        this.proxyFactory = nodeFactory.proxyFactory;

        try {
            Monitor monitor = nodeFactory.monitorFactory.createMonitor();
            ProcessorContext context = new ProcessorContext(monitor);

            // Set up the thead context monitor
            Monitor tcm = nodeFactory.monitorFactory.setContextMonitor(monitor);
            try {
                // Use the lack of the contributions collection as an indicator for when the node
View Full Code Here

            nodeFactory.getExtensionPointRegistry().getExtensionPoint(FactoryExtensionPoint.class)
                .getFactory(XMLOutputFactory.class);

        try {
            XMLStreamWriter xmlStreamWriter = outputFactory.createXMLStreamWriter(bos);
            compositeProcessor.write(composite, xmlStreamWriter, new ProcessorContext(nodeFactory.registry));
            xmlStreamWriter.flush();
        } catch(Exception ex) {
            return ex.toString();
        }
View Full Code Here

        Assert.assertEquals(2, op.getInputType().getLogical().size());
    }

    @Test
    public final void testInvalidWSDL() throws Exception {
        ProcessorContext context = new ProcessorContext();
        URL url = getClass().getResource("../xml/invalid-stockquote.wsdl");
        WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("invalid-stockquote.wsdl"), url, context);
        resolver.addModel(definition, context);
        definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
        PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);

        try {
            WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
            WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);

            op.isWrapperStyle();
            fail("InvalidWSDLException should have been thrown");
        } catch (InvalidInterfaceException e) {
View Full Code Here

            .append("\"/>");

        StAXHelper staxHelper = StAXHelper.getInstance(registry);
        XMLStreamReader reader = staxHelper.createXMLStreamReader(new StringReader(xml.toString()));
        reader.nextTag();
        Binding binding = (Binding)processor.read(reader, new ProcessorContext(registry));

        return binding;
    }
View Full Code Here

            WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
            wsdlInterfaceContract.setInterface(wsdlInterface);
            wsdlInterfaceContract.setLocation(javaInterface.getJAXWSWSDLLocation());
            javaInterfaceContract.setNormalizedWSDLContract(wsdlInterfaceContract);
           
            ProcessorContext wsdlContext = new ProcessorContext(javaInterface.getContributionContainingClass(),
                                                                context.getMonitor());
            extensionProcessor.resolve(wsdlInterfaceContract, resolver, wsdlContext);
           
            // check that the Java and WSDL contracts are compatible
            interfaceContractMapper.checkCompatibility(wsdlInterfaceContract,
View Full Code Here

        validationSchema = registry.getExtensionPoint(ValidationSchemaExtensionPoint.class);
       
        // Get the reference binder
        endpointReferenceBinder = registry.getExtensionPoint(EndpointReferenceBinder.class);
           
        loadSystemContribution(new ProcessorContext(monitorFactory.createMonitor()));

        inited = true;
    }
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.