From b39936ba3b1afbdcea36d2a25a4e4cf8af257a04 Mon Sep 17 00:00:00 2001 From: ramkumar Date: Tue, 10 Nov 2009 09:31:19 +0000 Subject: 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 --- .../apache/tuscany/sca/deployment/impl/DeployerImpl.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'java') 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 -- cgit v1.2.3