Package org.apache.tuscany.sca.contribution.resolver

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver.addModel()


        assertEquals("ABC", osgiProp2.getValue());
        assertEquals("prop2", osgiProp2.getName());

        ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
        staxProcessor.resolve(componentType, resolver, context);
        resolver.addModel(componentType, context);

        staxProcessor.resolve(composite, resolver, context);
       
        reader.close();
    }
View Full Code Here


                    XSDefinition scaSchema = xsdFactory.createXSDefinition();
                    scaSchema.setUnresolved(true);
                    scaSchema.setNamespace(Constants.SCA11_NS);
                    scaSchema.setLocation(IOHelper.toURI(scaSchemaURL));
                    scaSchema.setUnresolved(false);
                    modelResolver.addModel(scaSchema, context);                 
                }
            } catch (Exception ex) {
                throw new IllegalStateException(ex);
            }
        }       
View Full Code Here

        XMLStreamReader reader = getReader(xml);
        assertFalse(inited);
        ImportSDO importSDO = loader.read(reader);
        assertNotNull(importSDO);
        ModelResolver resolver = new TestModelResolver();
        resolver.addModel(new ClassReference(MockFactory.class));
        loader.resolve(importSDO, resolver);
        assertTrue(inited);
    }

    @Override
View Full Code Here

        reader = inputFactory.createXMLStreamReader(is);
        ComponentType ct = ctProcessor.read(reader);

        ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
        ctProcessor.resolve(ct, resolver);
        resolver.addModel(ct);
       
        compositeProcessor.resolve(composite, resolver);

        CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, new DefaultIntentAttachPointTypeFactory(), mapper, null, null);
        compositeUtil.build(composite);
View Full Code Here

            // Add the deployed artifact model to the resolver
            DeployedArtifact artifact = this.contributionFactory.createDeployedArtifact();
            artifact.setURI(a.toString());
            artifact.setLocation(artifactURL.toString());
            contribution.getArtifacts().add(artifact);
            modelResolver.addModel(artifact);

            // Let the artifact processor read the artifact into a model
            Object model = this.artifactProcessor.read(contributionURL, a, artifactURL);
            if (model != null) {
                artifact.setModel(model);
View Full Code Here

            Object model = this.artifactProcessor.read(contributionURL, a, artifactURL);
            if (model != null) {
                artifact.setModel(model);

                // Add the loaded model to the model resolver
                modelResolver.addModel(model);
            }
        }
    }

    /**
 
View Full Code Here

            // Add the deployed artifact model to the contribution
            Artifact artifact = this.contributionFactory.createArtifact();
            artifact.setURI(artifactURI);
            artifact.setLocation(artifactURL.toString());
            artifacts.add(artifact);
            modelResolver.addModel(artifact);

            // Read each artifact
            Object model = artifactProcessor.read(contributionURL, URI.create(artifactURI), artifactURL);
            if (model != null) {
                artifact.setModel(model);
View Full Code Here

            Object model = artifactProcessor.read(contributionURL, URI.create(artifactURI), artifactURL);
            if (model != null) {
                artifact.setModel(model);

                // Add the loaded model to the model resolver
                modelResolver.addModel(model);

                // Add policy definitions to the list of policy definitions
                if (policyDefinitionsResolver != null) {
                    addPolicyDefinitions(model);
                }
View Full Code Here

    public void resolve(Contribution contribution, ModelResolver resolver) throws ContributionResolveException {

        // Resolve the contribution model itself
        ModelResolver contributionResolver = contribution.getModelResolver();
        contribution.setUnresolved(false);
        contributionResolver.addModel(contribution);

        // Resolve imports and exports
        for (Export export: contribution.getExports()) {
            if (export instanceof DefaultExport) {
View Full Code Here

                // Add the deployed artifact model to the resolver
                Artifact artifact = this.contributionFactory.createArtifact();
                artifact.setURI(anArtifactUri.toString());
                artifact.setLocation(artifactURL.toString());
                contribution.getArtifacts().add(artifact);
                modelResolver.addModel(artifact);

                model = this.artifactProcessor.read(contributionURL, anArtifactUri, artifactURL);

                if (model != null) {
                    artifact.setModel(model);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.