summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-04-04 14:39:15 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-04-04 14:39:15 +0000
commit2fe313d51f7161bb90a44d8cd3f32b57345859a0 (patch)
tree246d9b040960b435282fce3753656a9e4e231107 /sca-java-2.x/trunk
parent05348835d5504700e44b51b832e56cf1f30fd396 (diff)
Validate the Spring beans xml service names are unique
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1088641 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
index 8c58ef0cf9..35543a87fe 100644
--- a/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
+++ b/sca-java-2.x/trunk/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
@@ -708,6 +708,16 @@ public class SpringXMLComponentTypeLoader {
List<SpringSCAPropertyElement> scaproperties,
Monitor monitor) throws ContributionReadException {
+ // The value of the @name attribute of an <sca:service/> subelement of a <beans/> element
+ // MUST be unique amongst the <service/> subelements of the <beans/> element.
+ for (SpringSCAServiceElement serviceElement : services) {
+ for (SpringSCAServiceElement x : services) {
+ if (serviceElement != x && serviceElement.getName().equals(x.getName())) {
+ error(monitor, "ScaServiceNameNotUnique", beans);
+ }
+ }
+ }
+
// The @target attribute of a <service/> subelement of a <beans/> element
// MUST have the value of the @name attribute of one of the <bean/>
// subelements of the <beans/> element.