Examples of ModelResolver


Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

    }
   
    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) {
               
                // Initialize the default export's resolver
                export.setModelResolver(contributionResolver);
               
            } else {
                extensionProcessor.resolve(export, contributionResolver);
            }
        }
        for (Import import_: contribution.getImports()) {
            extensionProcessor.resolve(import_, contributionResolver);
        }
       
        // Resolve all artifact models
        for (Artifact artifact : contribution.getArtifacts()) {
            Object model = artifact.getModel();
            if (model != null) {
                try {
                   artifactProcessor.resolve(model, contributionResolver);
                } catch (Exception e) {
                    //FIXME this shouldn't happen
                }
            }
        }
       
        // Resolve deployable composites
        List<Composite> deployables = contribution.getDeployables();
        for (int i = 0, n = deployables.size(); i < n; i++) {
            Composite deployable = deployables.get(i);
            Composite resolved = (Composite)contributionResolver.resolveModel(Composite.class, deployable);
            if (resolved != deployable) {
                deployables.set(i, resolved);
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

       
        // Create contribution model
        Contribution contribution = contributionFactory.createContribution();
        contribution.setURI(contributionURI.toString());
        contribution.setLocation(contributionURL.toString());
        ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
        contribution.setModelResolver(modelResolver);
        contribution.setUnresolved(true);

        // Create a contribution scanner
        ContributionScanner scanner;
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

    }
   
    public void resolve(Contribution contribution, ModelResolver resolver) throws ContributionResolveException {
       
        // Mark the contribution model resolved
        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

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

        InterfaceContract icontract = wsBinding.getBindingInterfaceContract();
        if (icontract == null) {
            icontract = ((Contract)contract).getInterfaceContract(wsBinding).makeUnidirectional(false);
            if (icontract instanceof JavaInterfaceContract) {
                ModelResolver resolver = component instanceof ResolverExtension ?
                                             ((ResolverExtension)component).getModelResolver() : null;
                icontract = createWSDLInterfaceContract(
                                    (JavaInterfaceContract)icontract,
                                    requiresSOAP12(wsBinding),
                                    resolver,
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

       
        IntentAttachPointType javaImplType = implTypesTable.get(javaImpl);
        assertNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
        assertNull(javaImplType.getMayProvideIntents().get(0).getDescription());
       
        ModelResolver resolver = new DefaultModelResolver();
        policyDefinitionsProcessor.resolve(definitions, resolver);
        //builder.build(scaDefinitions);
       
        //testing if policy intents have been linked have property been linked up
        assertNotNull(profileIntent.getRequiredIntents().get(0).getDescription());
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

    }

    @Ignore("To be fixed")
    @Test
    public void testPolicyIntents() throws Exception {
        ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
       
        URL url = getClass().getResource("definitions.xml");
        URI uri = URI.create("definitions.xml");
        Definitions scaDefns = policyDefinitionsProcessor.read(null, uri, url);
               
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

    }
   
    @Test
    @Ignore("Broken for now in 2.0 bringup")
    public void testPolicySets() throws Exception {
        ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
       
        URL url = getClass().getResource("definitions_with_policysets.xml");
        URI uri = URI.create("definitions_with_policysets.xml");
        Definitions policyDefinitions = policyDefinitionsProcessor.read(null, uri, url);
               
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

        // create a system contribution to hold the definitions. The contribution
        // will be extended later with definitions from application contributions
        systemContribution = contributionFactory.createContribution();
        systemContribution.setURI("http://tuscany.apache.org/SystemContribution");
        systemContribution.setLocation("Derived");
        ModelResolver modelResolver = new ExtensibleModelResolver(systemContribution, modelResolvers, modelFactories);
        systemContribution.setModelResolver(modelResolver);
        systemContribution.setUnresolved(true);
       
        // create an artifact to represent the system defintions and
        // add it to the contribution
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

        boolean found = false;
        Artifact compositeFile = contributionFactory.createArtifact();
        compositeFile.setUnresolved(true);
        compositeFile.setURI(composite.getURI());
        for (Contribution contribution: workspace.getContributions()) {
            ModelResolver resolver = contribution.getModelResolver();
//            for (Artifact artifact : contribution.getArtifacts()){
//                logger.log(Level.INFO,"artifact - " + artifact.getURI());
//            }
            Artifact resolvedArtifact = resolver.resolveModel(Artifact.class, compositeFile);
            if (!resolvedArtifact.isUnresolved() && resolvedArtifact.getModel() instanceof Composite) {
               
                if (!composite.isUnresolved()) {
                   
                    // The composite content was passed into the node and read into a composite model,
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.resolver.ModelResolver

        } else {
            packageName = null;
        }
       
        // First try to load the class using the Java import resolvers
        ModelResolver importResolver = importResolvers.get(packageName);
        if (importResolver != null) {
            ClassReference classReference = importResolver.resolveModel(ClassReference.class, new ClassReference(name));
            if (!classReference.isUnresolved()) {
                return classReference.getJavaClass();
            }
        }
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.