summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-11-10 09:31:19 +0000
committerramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68>2009-11-10 09:31:19 +0000
commitb39936ba3b1afbdcea36d2a25a4e4cf8af257a04 (patch)
treece7ba43071d05029f76a3646ad5b2129633547cf /java
parent30e8b84a149bff64446cf981267b876c5d42a255 (diff)
Fixes for resolving namespace imports using location attribute
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834397 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java b/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
index 65958a493c..e843db118a 100644
--- a/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
+++ b/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
@@ -50,6 +50,7 @@ import org.apache.tuscany.sca.contribution.ContributionFactory;
import org.apache.tuscany.sca.contribution.DefaultImport;
import org.apache.tuscany.sca.contribution.Export;
import org.apache.tuscany.sca.contribution.Import;
+import org.apache.tuscany.sca.contribution.namespace.NamespaceImport;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
@@ -153,6 +154,18 @@ public class DeployerImpl implements Deployer {
// Do not self import
continue;
}
+
+ // When a contribution contains a reference to an artifact from a namespace that
+ // is declared in an import statement of the contribution, if the SCA artifact
+ // resolution mechanism is used to resolve the artifact, the SCA runtime MUST resolve
+ // artifacts from the locations identified by the import statement(s) for the namespace.
+ if (import_ instanceof NamespaceImport) {
+ NamespaceImport namespaceImport = (NamespaceImport)import_;
+ if (namespaceImport.getLocation() != null)
+ if (!namespaceImport.getLocation().equals(dependency.getURI()))
+ continue;
+ }
+
for (Export export : dependency.getExports()) {
// If an export from a contribution matches the import in hand