Package org.apache.tuscany.sca.contribution

Examples of org.apache.tuscany.sca.contribution.DeployedArtifact


            resolveContracts(component, component.getServices(), resolver);
            resolveContracts(component, component.getReferences(), resolver);
           
            for (ComponentProperty componentProperty : component.getProperties()) {
                if (componentProperty.getFile() != null) {
                    DeployedArtifact deployedArtifact = contributionFactory.createDeployedArtifact();
                    deployedArtifact.setURI(componentProperty.getFile());
                    deployedArtifact = resolver.resolveModel(DeployedArtifact.class, deployedArtifact);
                    if (deployedArtifact.getLocation() != null) {
                        componentProperty.setFile(deployedArtifact.getLocation());
                    }
                }
            }
           
            //resolve component implemenation
View Full Code Here


    }

    public void resolve(WidgetImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
       
        // Resolve the resource directory location
        DeployedArtifact artifact = contributionFactory.createDeployedArtifact();
        artifact.setURI(implementation.getLocation());
        DeployedArtifact resolved = resolver.resolveModel(DeployedArtifact.class, artifact);
        if (resolved.getLocation() != null) {
            try {
                implementation.setLocationURL(new URL(resolved.getLocation()));
                implementation.setUnresolved(false);
            } catch (IOException e) {
                throw new ContributionResolveException(e);
            }
        }
View Full Code Here

    /**
     * Add a composite model to the contribution
     */
    public void addDeploymentComposite(Contribution contribution, Composite composite) throws ContributionException {
        DeployedArtifact artifact = this.contributionFactory.createDeployedArtifact();
        artifact.setURI(composite.getURI());
        artifact.setModel(composite);

        contribution.getArtifacts().add(artifact);

        contribution.getDeployables().add(composite);
    }
View Full Code Here

        URL contributionURL = new URL(contribution.getLocation());
        for (URI a : artifacts) {
            URL artifactURL = packageProcessor.getArtifactURL(new URL(contribution.getLocation()), a);

            // 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);

                // Add the loaded model to the model resolver
                modelResolver.addModel(model);
               
                if ( model instanceof SCADefinitions ) {
View Full Code Here

            }

            for (ComponentProperty componentProperty : component
                    .getProperties()) {
                if (componentProperty.getFile() != null) {
                    DeployedArtifact deployedArtifact = contributionFactory
                            .createDeployedArtifact();
                    deployedArtifact.setURI(componentProperty.getFile());
                    deployedArtifact = resolver.resolveModel(
                            DeployedArtifact.class, deployedArtifact);
                    if (deployedArtifact.getLocation() != null) {
                        componentProperty.setFile(deployedArtifact
                                .getLocation());
                    }
                }
            }
            resolveIntents(component.getRequiredIntents(), resolver);
View Full Code Here

            component.setImplementation(implementation);
        }

        for (ComponentProperty componentProperty : component.getProperties()) {
            if (componentProperty.getFile() != null) {
                DeployedArtifact deployedArtifact = contributionFactory
                        .createDeployedArtifact();
                deployedArtifact.setURI(componentProperty.getFile());
                deployedArtifact = resolver.resolveModel(
                        DeployedArtifact.class, deployedArtifact);
                if (deployedArtifact.getLocation() != null) {
                    componentProperty.setFile(deployedArtifact.getLocation());
                }
            }
        }
        resolveIntents(component.getRequiredIntents(), resolver);
        resolvePolicySets(component.getPolicySets(), resolver);
View Full Code Here

            }

            for (ComponentProperty componentProperty : component
                    .getProperties()) {
                if (componentProperty.getFile() != null) {
                    DeployedArtifact deployedArtifact = contributionFactory
                            .createDeployedArtifact();
                    deployedArtifact.setURI(componentProperty.getFile());
                    deployedArtifact = resolver.resolveModel(
                            DeployedArtifact.class, deployedArtifact);
                    if (deployedArtifact.getLocation() != null) {
                        componentProperty.setFile(deployedArtifact
                                .getLocation());
                    }
                }
            }
            resolveIntents(component.getRequiredIntents(), resolver);
View Full Code Here

            component.setImplementation(implementation);
        }

        for (ComponentProperty componentProperty : component.getProperties()) {
            if (componentProperty.getFile() != null) {
                DeployedArtifact deployedArtifact = contributionFactory
                        .createDeployedArtifact();
                deployedArtifact.setURI(componentProperty.getFile());
                deployedArtifact = resolver.resolveModel(
                        DeployedArtifact.class, deployedArtifact);
                if (deployedArtifact.getLocation() != null) {
                    componentProperty.setFile(deployedArtifact.getLocation());
                }
            }
        }
        resolveIntents(component.getRequiredIntents(), resolver);
        resolvePolicySets(component.getPolicySets(), resolver);
View Full Code Here

    }

    public void resolve(ResourceImplementation impl, ModelResolver resolver) throws ContributionResolveException {
       
        // Resolve the resource directory location
        DeployedArtifact artifact = contributionFactory.createDeployedArtifact();
        artifact.setURI(impl.getLocation());
        DeployedArtifact resolved = resolver.resolveModel(DeployedArtifact.class, artifact);
        if (resolved.getLocation() != null) {
            try {
                impl.setLocationURL(new URL(resolved.getLocation()));
                impl.setUnresolved(false);
            } catch (IOException e) {
                throw new ContributionResolveException(e);
            }
        }
View Full Code Here

        assertTrue(clazz.isUnresolved());
        assertTrue(clazz.getJavaClass() == null);
    }
   
    public void testResolvedArtifact() {
        DeployedArtifact artifact = factory.createDeployedArtifact();
        artifact.setURI("foo/bar");
        resolver.addModel(artifact);
        DeployedArtifact x = factory.createDeployedArtifact();
        x.setURI("foo/bar");
        x = resolver.resolveModel(DeployedArtifact.class, x);
        assertTrue(x == artifact);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.DeployedArtifact

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.