Examples of DeployedArtifact


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

                URL url = null;
                if (importLocation.startsWith("/")) {
                    // The URI is relative to the contribution
                    String uri = importLocation.substring(1);

                    DeployedArtifact proxyArtifact = contributionFactory.createDeployedArtifact();
                    proxyArtifact.setURI(uri);

                    //use contribution resolution (this supports import/export)
                    DeployedArtifact importedArtifact =
                        contribution.getModelResolver().resolveModel(DeployedArtifact.class, proxyArtifact);
                    if (importedArtifact.getLocation() != null) {
                        //get the artifact URL
                        url = new URL(importedArtifact.getLocation());
                    }
                } else {
                    url = new URL(new URL(parentLocation), importLocation);
                }
                if (url == null) {
View Full Code Here

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

                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

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

    /**
     * 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

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

        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);
            }
        }
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.