From 142b72b19538405625992f9d2686d3d677784b24 Mon Sep 17 00:00:00 2001 From: slaws Date: Thu, 8 Apr 2010 09:08:59 +0000 Subject: TUSCANY-3527 report error id binding.sca at a service has a uri. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@931842 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/builder/impl/ComponentBuilderImpl.java | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'sca-java-2.x/trunk/modules/builder/src/main/java') diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java index 2be14e4c6d..c8d60bd021 100644 --- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java +++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/ComponentBuilderImpl.java @@ -240,7 +240,7 @@ public class ComponentBuilderImpl { calculateServiceInterfaceContract(component, componentService, componentTypeService, monitor); // bindings - calculateBindings(componentService, componentTypeService); + calculateBindings(component, componentService, componentTypeService, monitor); // add callback reference model objects createCallbackReference(component, componentService); @@ -1183,7 +1183,7 @@ public class ComponentBuilderImpl { * @param componentService the top service * @param componentTypeService the bottom service */ - private void calculateBindings(Service componentService, Service componentTypeService) { + private void calculateBindings(Component component, Service componentService, Service componentTypeService, Monitor monitor) { // forward bindings if (componentService.getBindings().isEmpty()) { componentService.getBindings().addAll(componentTypeService.getBindings()); @@ -1203,6 +1203,23 @@ public class ComponentBuilderImpl { } else if (componentService.getCallback().getBindings().isEmpty() && componentTypeService.getCallback() != null) { componentService.getCallback().getBindings().addAll(componentTypeService.getCallback().getBindings()); } + + // [ASM90005] validate that binding.sca has no uri set + for (Binding binding : componentService.getBindings()){ + if (binding instanceof SCABinding){ + if ((binding.getURI() != null) && + (binding.getURI().length() > 0)){ + Monitor.error(monitor, + this, + Messages.BUILDER_VALIDATION_BUNDLE, + "URIFoundOnServiceSCABinding", + binding.getName(), + component.getName(), + componentService.getName(), + binding.getURI()); + } + } + } } @@ -1224,7 +1241,6 @@ public class ComponentBuilderImpl { } else if (componentReference.getCallback().getBindings().isEmpty() && componentTypeReference.getCallback() != null) { componentReference.getCallback().getBindings().addAll(componentTypeReference.getCallback().getBindings()); } - } } -- cgit v1.2.3