summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/contrib
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-05-23 09:08:11 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-05-23 09:08:11 +0000
commiteb020400c447f4dae47dd82385ee9b3eceef515a (patch)
treef8c24d15f4915070ed9c8056b487a4eb33cf0509 /sca-java-2.x/contrib
parentbfc20f0713455f2e08e28bcea825b4f792d48e58 (diff)
Updateto use getLocationAsURL from common module, add some todo's and delete some blank lines
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@947387 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib')
-rw-r--r--sca-java-2.x/contrib/modules/section10/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java22
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);
- }
- }
}