Package org.apache.tuscany.sca.contribution.service

Examples of org.apache.tuscany.sca.contribution.service.ContributionService


        } catch (IOException e) {
            throw new ActivationException(e);
        }

        ExtensibleURLArtifactProcessor documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);
        ContributionService contributionService = new ContributionServiceImpl(repository, packageProcessor,
                                                                              documentProcessor, assemblyFactory,
                                                                              contributionFactory, xmlFactory);
        return contributionService;
    }
View Full Code Here


        } catch (ActivationException e) {
            throw new ServiceRuntimeException(e);
        }

        // Contribute the given contribution to an in-memory repository
        ContributionService contributionService = runtime.getContributionService();
        URL contributionURL;
        try {
            contributionURL = getContributionLocation(applicationClassLoader, location, this.composites);
        } catch (MalformedURLException e) {
            throw new ServiceRuntimeException(e);
        }

        try {
            ModelResolverImpl modelResolver = new ModelResolverImpl(applicationClassLoader);
            String contributionURI = FileHelper.getName(contributionURL.getPath());
            contribution = contributionService.contribute(contributionURI, contributionURL, modelResolver, false);
        } catch (ContributionException e) {
            throw new ServiceRuntimeException(e);
        } catch (IOException e) {
            throw new ServiceRuntimeException(e);
        }
View Full Code Here

    public void close() {
       
        super.close();

        // Remove the contribution from the in-memory repository
        ContributionService contributionService = runtime.getContributionService();
        try {
            contributionService.remove(contribution.getURI());
        } catch (ContributionException e) {
            throw new ServiceRuntimeException(e);
        }
       
        // Stop the SCA domain composite
View Full Code Here

        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        monitor = monitorFactory.createMonitor();

        // Contribute the given contribution to an in-memory repository
        ContributionService contributionService = runtime.getContributionService();
        URL contributionURL;
        try {
            contributionURL = getContributionLocation(applicationClassLoader, contributionLocation, this.composites);
            if (contributionURL != null) {
                // Make sure the URL is correctly encoded (for example, escape the space characters)
View Full Code Here

                throw new ServiceRuntimeException(e);
            }
        }

        // Remove the contribution from the in-memory repository
        ContributionService contributionService = runtime.getContributionService();
        for (Contribution contribution : contributions) {
            try {
                contributionService.remove(contribution.getURI());
            } catch (ContributionException e) {
                throw new ServiceRuntimeException(e);
            }
        }
View Full Code Here

     *       located in META-INF/deployables or specified in the sca-deployables.xml. Maybe the EmbeddedSCADomain
     *       and ContributionService APIs should make all this easier?
     */
    protected void initContributions(EmbeddedSCADomain scaDomain,  ClassLoader cl, URL[] contributionJars) {
      Contribution contribution = null;
        ContributionService contributionService = scaDomain.getContributionService();
        for (URL jar : contributionJars) {
            InputStream is = null;
            try {
                is = jar.openStream();
                contribution = contributionService.contribute(jar.toString(), jar, is);
            } catch (Exception e) {
                System.err.println("exception adding contribution: " + jar);
                e.printStackTrace();
            }
            if (is != null) {
View Full Code Here

        OSGiTestUtil.setUpOSGiTestRuntime();

        scaDomain = new EmbeddedSCADomain(this.getClass().getClassLoader(), "http://localhost");
        scaDomain.start();
        ContributionService contributionService = scaDomain.getContributionService();
       
        URL serviceURL = new File("./target/classes/sdo/ds/HelloWorldService.jar").toURI().toURL();
        URL clientURL = new File("./target/classes/sdo/ds/HelloWorldClient.jar").toURI().toURL();
       
        Contribution serviceContribution = contributionService.contribute("HelloWorldService", serviceURL, true);
        Contribution clientContribution = contributionService.contribute("HelloWorldClient", clientURL, true);
       
        for (Composite deployable : serviceContribution.getDeployables()) {
            scaDomain.getDomainComposite().getIncludes().add(deployable);
            scaDomain.buildComposite(deployable);
        }
View Full Code Here

        // Start the domain
        domain.start();

        // Contribute the SCA contribution
        ContributionService contributionService = domain.getContributionService();

        helloContribution =
            contributionService.contribute("http://contribution-multiple/helloworld", helloContribution_URL, false);

        //helloWorldContribution_one =
         //   contributionService.contribute("http://contribution-multiple/helloworld_one", helloWorldContribution_one_URL, false);

        helloWorldContribution_two =
            contributionService.contribute("http://contribution-multiple/helloworld_two", helloWorldContribution_two_URL, false);

        for (Composite deployable : helloContribution.getDeployables()) {
            domain.getDomainComposite().getIncludes().add(deployable);
            domain.buildComposite(deployable);
        }
View Full Code Here

        assertEquals("Hello Smith", helloWorldService_two.getGreetings("Smith"));
       
    }

    public void tearDown() throws Exception {
        ContributionService contributionService = domain.getContributionService();

        // Remove the contribution from the in-memory repository
        contributionService.remove("http://contribution-multiple/helloworld");
        //contributionService.remove("http://contribution-multiple/helloworld_one");
        contributionService.remove("http://contribution-multiple/helloworld_two");

        // Stop Components from my composite
        for (Composite deployable : helloWorldContribution_two.getDeployables()) {
            domain.getCompositeActivator().stop(deployable);
            domain.getCompositeActivator().deactivate(deployable);
View Full Code Here

        // Start the domain
        domain.start();

        // Contribute the SCA contribution
        ContributionService contributionService = domain.getContributionService();

        helloContribution =
            contributionService.contribute("http://contribution-multiple/helloworld", helloContribution_URL, false);

        helloWorldContribution_one =
            contributionService.contribute("http://contribution-multiple/helloworld_one", helloWorldContribution_one_URL, false);

        helloWorldContribution_two =
            contributionService.contribute("http://contribution-multiple/helloworld_two", helloWorldContribution_two_URL, false);

        for (Composite deployable : helloContribution.getDeployables()) {
            domain.getDomainComposite().getIncludes().add(deployable);
        }
               
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.service.ContributionService

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.