summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java14
-rw-r--r--java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties1
2 files changed, 13 insertions, 2 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
index b20a788027..8c7b4117f4 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
@@ -948,8 +948,18 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt
for (int i = 0, n = composite.getIncludes().size(); i < n; i++) {
Composite include = composite.getIncludes().get(i);
if (include != null) {
- include = resolver.resolveModel(Composite.class, include);
- composite.getIncludes().set(i, include);
+ Composite resolved = resolver.resolveModel(Composite.class, include);
+ if (!resolved.isUnresolved()) {
+ if ((composite.isLocal() && resolved.isLocal()) || (!composite.isLocal() && !resolved.isLocal())) {
+ composite.getIncludes().set(i, resolved);
+ } else {
+ ContributionResolveException ce = new ContributionResolveException("Error: Composite "+ composite.getName() +" can only include another composite with the identical @local attribute value");
+ error("ContributionResolveException", include, ce);
+ }
+ } else {
+ ContributionResolveException ce = new ContributionResolveException("Error: Composite "+ include.getName() +" is not a valid composite within the domain");
+ error("ContributionResolveException", include, ce);
+ }
}
}
diff --git a/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
index 5a633ff22e..fe29a3be28 100644
--- a/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
+++ b/java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties
@@ -25,6 +25,7 @@ UnexpectedImplementationElement = Unexpected <implementation> element found. It
PolicyImplValidationException = PolicyValidation exception when processing implementation of component {0} due to {1}.
PolicyServiceValidationException = PolicyValidation exceptions when processing service/reference {0} in {1}. Error is {2}
ContributionReadException = ContributionReadException occured due to : {0}
+ContributionResolveException = ContributionResolveException occured due to : {0}
ContributionWriteException = ContributionWriteException occured due to : {0}
XMLStreamException = XMLStreamException occured due to : {0}
DuplicateCompositeName = [ASM_6001] More than one composite with the same name {0} found in contribution {1}