diff options
Diffstat (limited to 'sca-java-2.x/contrib/modules/section10/src/main')
-rw-r--r-- | sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java b/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java index 8f13a35494..f41023e845 100644 --- a/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java +++ b/sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java @@ -19,9 +19,7 @@ package org.apache.tuscany.sca.something.impl;
-import java.io.File;
import java.io.Reader;
-import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
@@ -84,12 +82,12 @@ public class Section10Impl implements Section10 { public void installContribution(String uri, String contributionURL, List<String> dependentContributionURIs, boolean autoDeploy) throws ContributionReadException, ActivationException {
Monitor monitor = deployer.createMonitor();
- URL url = getLocationAsURL(contributionURL);
+ URL url = IOHelper.getLocationAsURL(contributionURL);
Contribution contribution = deployer.loadContribution(URI.create(uri), url, monitor);
InstalledContribution ic = new InstalledContribution(uri, url.toString(), contribution);
installedContributions.put(uri, ic);
if (autoDeploy) {
- for (Composite c : contribution.getDeployables()) {
+ for (Composite c : ic.getDefaultDeployables()) {
deployComposite(c, ic);
}
}
@@ -103,7 +101,8 @@ public class Section10Impl implements Section10 { Monitor monitor = monitorFactory.createMonitor();
Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
-
+ // TODO: does this need to do check the monitor
+
String compositeArtifcatURI = composite.getName().getLocalPart() + ".composite";
for (Artifact a : ic.getContribution().getArtifacts()) {
if (compositeArtifcatURI.equals(a.getURI())) {
@@ -112,9 +111,7 @@ public class Section10Impl implements Section10 { }
deployer.attachDeploymentComposite(ic.getContribution(), composite, true);
-
deployComposite(composite, ic);
-
return compositeArtifcatURI;
}
@@ -246,15 +243,4 @@ public class Section10Impl implements Section10 { ic.getDeployedComposites().add(dc);
}
- protected URL getLocationAsURL(String location) throws ContributionReadException {
- URI uri = IOHelper.createURI(location);
- if (uri.getScheme() == null) {
- uri = new File(location).toURI();
- }
- try {
- return uri.toURL();
- } catch (MalformedURLException e) {
- throw new ContributionReadException(e);
- }
- }
}
|