diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/builder')
2 files changed, 21 insertions, 4 deletions
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()); } - } } diff --git a/sca-java-2.x/trunk/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties b/sca-java-2.x/trunk/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties index f16b24f0dc..f2cfafeda8 100644 --- a/sca-java-2.x/trunk/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties +++ b/sca-java-2.x/trunk/modules/builder/src/main/resources/org/apache/tuscany/sca/builder/builder-validation-messages.properties @@ -30,4 +30,5 @@ JaxWSClientAsyncMethodsNotAllowed = [CA100006] JAX-WS client-side asynchronous p PolicySetNotFoundAtBuild = PolicySet {0} is not defined in SCA definitions IntentNotSatisfiedAtBuild = The intent {0} associated with policy subject {1} has no matching policy set MutuallyExclusiveIntentsAtBuild = [POL40009,ASM60009,ASM60010] Intent {0} and {1} are mutually exclusive -IntentNotFoundAtBuild = = Intent {0} is not defined in SCA definitions +IntentNotFoundAtBuild = Intent {0} is not defined in SCA definitions +URIFoundOnServiceSCABinding = [ASM90005] The SCA binding {0} on component {1} service {2} should not have a URI and the URI is currently set to {3} |