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

Examples of org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl


           
            if ( contributionURL != null ){
                logger.log(Level.INFO, "Domain management configured from " + contributionURL);
                          
                // set up a model resolver with the classloader for this domain/node
                ModelResolverImpl modelResolver = new ModelResolverImpl(domainClassLoader);
               
                // add node composite to the management domain
                domainManagementContributionService = domainManagementRuntime.getContributionService();
                domainManagementContribution = domainManagementContributionService.contribute("nodedomain",
                                                                                              contributionURL,
View Full Code Here


        domain.start();

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

        ModelResolver helloResolver = new ModelResolverImpl(cl);
        File helloContrib = new File("./target/classes/");
        URL helloURL = helloContrib.toURL();
        Contribution consumerContribution =
            contributionService.contribute("http://import-export/hello", helloURL, helloResolver, false);
        Composite consumerComposite = consumerContribution.getDeployables().get(0);
View Full Code Here

        } 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) {
View Full Code Here

        } 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) {
View Full Code Here

   
    private ModelResolver resolver;
    private ContributionFactory factory;
   
    protected void setUp() throws Exception {
        resolver = new ModelResolverImpl(getClass().getClassLoader());
        factory = new ContributionFactoryImpl();
    }
View Full Code Here

        ContributionFactory factory = new ContributionFactoryImpl();
        ContributionMetadataLoaderImpl loader =
            new ContributionMetadataLoaderImpl(new DefaultAssemblyFactory(), factory);
        Contribution contribution = factory.createContribution();
        contribution.setModelResolver(new ModelResolverImpl(getClass().getClassLoader()));
        loader.load(contribution, reader);
        assertNotNull(contribution);
        assertEquals(1, contribution.getImports().size());
        assertEquals(1, contribution.getExports().size());
        assertEquals(2, contribution.getDeployables().size());
View Full Code Here

        XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML));
        ContributionFactory factory = new ContributionFactoryImpl();
        ContributionMetadataLoaderImpl loader =
            new ContributionMetadataLoaderImpl(new DefaultAssemblyFactory(), factory);
        Contribution contribution = factory.createContribution();
        contribution.setModelResolver(new ModelResolverImpl(getClass().getClassLoader()));
        try {
            loader.load(contribution, reader);
            fail("InvalidException should have been thrown");
        } catch (InvalidValueException e) {
            assertTrue(true);
View Full Code Here

    }

    public void testContributeJAR() throws Exception {
        URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
        String contributionId = CONTRIBUTION_001_ID;
        ModelResolver resolver = new ModelResolverImpl(getClass().getClassLoader());
        contributionService.contribute(contributionId, contributionLocation, resolver, false);
        assertNotNull(contributionService.getContribution(contributionId));
    }
View Full Code Here

    }

    public void testStoreContributionPackageInRepository() throws Exception {
        URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
        String contributionId = CONTRIBUTION_001_ID;
        ModelResolver resolver = new ModelResolverImpl(getClass().getClassLoader());
        contributionService.contribute(contributionId, contributionLocation, resolver, true);

        assertTrue(FileHelper.toFile(new URL(contributionService.getContribution(contributionId).getLocation()))
            .exists());
View Full Code Here

        URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
        String contributionId = CONTRIBUTION_001_ID;

        InputStream contributionStream = contributionLocation.openStream();
        try {
            ModelResolver resolver = new ModelResolverImpl(getClass().getClassLoader());
            contributionService.contribute(contributionId, contributionLocation, contributionStream, resolver);
        } finally {
            IOHelper.closeQuietly(contributionStream);
        }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl

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.