Examples of ContributionDescription


Examples of org.apache.tuscany.sca.runtime.ContributionDescription

    public Contribution getContribution(String contributionURI) throws ContributionReadException, ValidationException {
        return loadContribution(getInstalledContribution(contributionURI));
    }

    public List<String> getDeployableCompositeURIs(String contributionURI) {
        ContributionDescription cd = domainRegistry.getInstalledContribution(contributionURI);
        List<String> deployables = new ArrayList<String>(cd.getDeployables());
        deployables.addAll(cd.getAdditionalDeployables().keySet());
        return deployables;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

        deployables.addAll(cd.getAdditionalDeployables().keySet());
        return deployables;
    }
   
    public String addDeploymentComposite(String contributionURI, Reader compositeXML) throws ContributionReadException, XMLStreamException, ValidationException {
        ContributionDescription cd = getInstalledContribution(contributionURI);
       
        // load it to check its valid composite XML
        Composite composite = deployer.loadXMLDocument(compositeXML);
       
        return addDeploymentComposite(cd, composite);
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

       
        return addDeploymentComposite(cd, composite);
    }

    public String addDeploymentComposite(String contributionURI, Composite composite) {
        ContributionDescription cd = getInstalledContribution(contributionURI);
        return addDeploymentComposite(cd, composite);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

        if (logger.isLoggable(quietLogging? Level.FINE : Level.INFO)) logger.log(quietLogging? Level.FINE : Level.INFO, "addDeploymentComposite: " + composite.getURI());
        return composite.getURI();
    }

    public void validateContribution(String contributionURI) throws ContributionReadException, ValidationException {
        ContributionDescription cd = getInstalledContribution(contributionURI);
        Contribution contribution = loadContribution(cd);

        Monitor monitor = deployer.createMonitor();
        try {
          ArrayList<Contribution> cs = new ArrayList<Contribution>();
          cs.add(contribution);
          cs.addAll(calculateDependentContributions(cd));
            deployer.resolve(cs, null, monitor);
        } catch (Exception e) {
            loadedContributions.remove(cd.getURI());
            throw new RuntimeException(e);
        }
        try {
            monitor.analyzeProblems();
        } catch (ValidationException e) {
            loadedContributions.remove(cd.getURI());
            throw e;
        }
        if (contribution.getClassLoader() == null && contribution.getModelResolver() instanceof ExtensibleModelResolver) {
            ModelResolver o = ((ExtensibleModelResolver)contribution.getModelResolver()).getModelResolverInstance(ClassReference.class);
            if (o instanceof ClassLoader) {
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

        try {
            if (dc != null) {
                dc.start();
                startedComposites.put(key, dc);
            } else {
                ContributionDescription cd = getInstalledContribution(contributionURI);
                Contribution contribution = loadContribution(cd);
                Composite composite = contribution.getArtifactModel(compositeURI);
                List<Contribution> dependentContributions = calculateDependentContributions(cd);
                dc = new DeployedComposite(composite, contribution, dependentContributions, deployer, compositeActivator, domainRegistry, extensionPointRegistry, endpointsIncludeDomainName);
                dc.start();
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

    public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {
        return ServiceHelper.getService(interfaze, serviceURI, domainRegistry, extensionPointRegistry, deployer);
    }

    public ContributionDescription getInstalledContribution(String contributionURI) {
        ContributionDescription cd = domainRegistry.getInstalledContribution(contributionURI);
        if (cd == null) {
            throw new IllegalArgumentException("Contribution not installed: " + contributionURI);
        }
        return cd;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

        Map<String, Contribution> dependentContributions = new HashMap<String, Contribution>();
        if (cd.getDependentContributionURIs() != null && cd.getDependentContributionURIs().size() > 0) {
            // if the install specified dependent uris use just those contributions
            for (String uri : cd.getDependentContributionURIs()) {
                if (!!!dependentContributions.containsKey(uri)) {
                    ContributionDescription dependee = domainRegistry.getInstalledContribution(uri);
                    if (dependee != null) {
                        dependentContributions.put(uri, loadContribution(dependee));
                    }
                }
            }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

    private List<ContributionDescription> findExportingContributions(Import imprt) {
        List<ContributionDescription> ics = new ArrayList<ContributionDescription>();
        // TODO: Handle Imports in a more extensible way
        for (String curi : domainRegistry.getInstalledContributionURIs()) {
            ContributionDescription cd = domainRegistry.getInstalledContribution(curi);
            if (imprt instanceof JavaImport) {
                for (String s : cd.getJavaExports()) {
                    if (s.startsWith(((JavaImport)imprt).getPackage())) {
                        ics.add(cd);
                    }
                }
            } else if (imprt instanceof NamespaceImport) {
                if (cd.getNamespaceExports().contains(((NamespaceImport)imprt).getNamespace())) {
                    ics.add(cd);
                }
            }
        }
        return ics;
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

    private void findInterface(Endpoint endpoint) throws MalformedURLException, ClassNotFoundException {
        Interface iface = endpoint.getService().getInterfaceContract().getInterface();
        if (iface instanceof JavaInterface) {
            String curi = domainRegistry.getContainingCompositesContributionURI(endpoint.getComponent().getName());
            if (curi != null) {
                ContributionDescription ic = domainRegistry.getInstalledContribution(curi);
                ClassLoader cl = new URLClassLoader(new URL[]{new URL(ic.getURL())});
                serviceInterface = cl.loadClass(((JavaInterface)iface).getName());
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ContributionDescription

        Assert.assertTrue(nodeB.getInstalledContributionURIs().contains("export"));
        Assert.assertTrue(nodeB.getInstalledContributionURIs().contains("helloworld"));
        Contribution cB = nodeB.getContribution("helloworld");
        Assert.assertNotNull(cB);

        ContributionDescription cd = ((NodeImpl)nodeB).getInstalledContribution("export");
        Assert.assertEquals(1, cd.getJavaExports().size());
        Assert.assertEquals("sample", cd.getJavaExports().get(0));
        } finally {
            runtime.stop();
        }
    }
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.