summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-09-03 16:54:38 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-09-03 16:54:38 +0000
commitfe84c69d568e201386f3e8fbc78c0cb750a40f45 (patch)
treed82d5632ae250ffa2bbc43e3dfb3dd0fd8405b77 /java/sca/modules
parentfbe9f35faac59767f6957f5a2a7e66486713a1e0 (diff)
Initial basic support for web.composite, see TUSCANY-2581
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@691684 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java b/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java
index a91f620ad2..7b8b12ca9d 100644
--- a/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java
+++ b/java/sca/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java
@@ -409,6 +409,8 @@ public class ContributionServiceImpl implements ContributionService {
}
}
+ processApplicationComposite(contribution);
+
// store the contribution on the registry
this.contributionRepository.addContribution(contribution);
@@ -416,6 +418,40 @@ public class ContributionServiceImpl implements ContributionService {
}
/**
+ * Process any application composite (eg see 5.1.3 of SCA JEE spec)
+ * TODO: see TUSCANY-2581
+ */
+ private void processApplicationComposite(Contribution contribution) {
+
+ Composite composite = findComposite("web-inf/web.composite", contribution);
+ if (composite != null) {
+ if (!contribution.getDeployables().contains(composite)) {
+ contribution.getDeployables().add(createDeploymentComposite(composite));
+ }
+ }
+ }
+
+ /**
+ * Create a deployment composite for the composite
+ * See line 247 section 5.1.3 of SCA JEE spec
+ */
+ private Composite createDeploymentComposite(Composite composite) {
+ // TODO: for now just use as-is
+ return composite;
+ }
+
+ private Composite findComposite(String name, Contribution contribution) {
+ for (Artifact artifact : contribution.getArtifacts()) {
+ if (artifact.getModel() instanceof Composite) {
+ if (name.equalsIgnoreCase(artifact.getURI())) {
+ return (Composite)artifact.getModel();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
* This utility method process each artifact and delegates to proper
* artifactProcessor to read the model and generate the in-memory representation
*