From eb020400c447f4dae47dd82385ee9b3eceef515a Mon Sep 17 00:00:00 2001 From: antelder Date: Sun, 23 May 2010 09:08:11 +0000 Subject: 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 --- .../tuscany/sca/something/impl/Section10Impl.java | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'sca-java-2.x/contrib/modules/section10/src/main') 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 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); - } - } } -- cgit v1.2.3