summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-07 02:43:54 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-08-07 02:43:54 +0000
commit2145edec90514297c15d76067328376d68eff35f (patch)
treee816f08d44be5d5269d72ad54d2b56d24e7405cf
parent01917ee0f9256dca86808f438351025892314d06 (diff)
Ensure that the deployables are the correct Composite objects
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@983165 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java
index 40a92d74f3..6e6346fe47 100644
--- a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java
+++ b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java
@@ -24,6 +24,7 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
+import java.util.ListIterator;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.contribution.Artifact;
@@ -191,6 +192,19 @@ public class ContributionContentProcessor implements ExtendedURLArtifactProcesso
contribution.getImports().add(defaultImport);
DefaultExport defaultExport = contributionFactory.createDefaultExport();
contribution.getExports().add(defaultExport);
+ } else {
+ if (contribution.getDeployables().size() > 0) {
+ // Update the deployable Composite objects with the correct Composite object for the artifact
+ for (Artifact a : contribution.getArtifacts()) {
+ if (a.getModel() instanceof Composite) {
+ for (ListIterator<Composite> lit = contribution.getDeployables().listIterator(); lit.hasNext();) {
+ if (lit.next().getName().equals(((Composite)a.getModel()).getName())) {
+ lit.set((Composite)a.getModel());
+ }
+ }
+ }
+ }
+ }
}
} finally {
monitor.popContext();