diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-sca-runtime')
2 files changed, 12 insertions, 13 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java index 14c8fae369..c4466a9d90 100644 --- a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java +++ b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java @@ -134,7 +134,7 @@ public class DefaultSCABindingMapper implements SCABindingMapper { // we know we can clone endpoint references } - Binding binding = map(endpoint.getBinding(), false); + Binding binding = map(endpoint.getBinding()); ep.setBinding(binding); if (builder != null) { builder.build(ep.getComponent(), ep.getService(), binding, new BuilderContext(registry)); @@ -154,7 +154,7 @@ public class DefaultSCABindingMapper implements SCABindingMapper { // we know we can clone endpoint references } - Binding binding = map(endpointReference.getBinding(), true); + Binding binding = map(endpointReference.getBinding()); epr.setBinding(binding); // epr.setTargetEndpoint(map((RuntimeEndpoint)epr.getTargetEndpoint())); @@ -166,14 +166,11 @@ public class DefaultSCABindingMapper implements SCABindingMapper { return epr; } - protected Binding map(Binding scaBinding, boolean referenceSide) { + protected Binding map(Binding scaBinding) { try { Binding binding = createDelegatingBinding(); binding.setName(scaBinding.getName()); - if (!referenceSide) { - // Only set the binding URI for the service side - binding.setURI(scaBinding.getURI()); - } + binding.setURI(scaBinding.getURI()); binding.setOperationSelector(scaBinding.getOperationSelector()); binding.setRequestWireFormat(scaBinding.getRequestWireFormat()); binding.setResponseWireFormat(scaBinding.getResponseWireFormat()); diff --git a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java index 47625b5d5d..ca90878633 100644 --- a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java @@ -21,7 +21,6 @@ package org.apache.tuscany.sca.binding.sca.provider; import java.util.logging.Logger; -import org.apache.tuscany.sca.assembly.Binding; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.provider.ServiceBindingProvider; import org.apache.tuscany.sca.runtime.RuntimeEndpoint; @@ -37,14 +36,15 @@ public class DelegatingSCAServiceBindingProvider implements ServiceBindingProvid private static final Logger logger = Logger.getLogger(DelegatingSCAServiceBindingProvider.class.getName()); private ServiceBindingProvider provider; - protected Class<? extends Binding> bindingClass; + private RuntimeEndpoint endpoint; + private RuntimeEndpoint mappedEndpoint; private boolean started = false; public DelegatingSCAServiceBindingProvider(RuntimeEndpoint endpoint, SCABindingMapper mapper) { - RuntimeEndpoint ep = mapper.map(endpoint); - if (ep != null) { - endpoint.setBinding(ep.getBinding()); - provider = ep.getBindingProvider(); + this.endpoint = endpoint; + this.mappedEndpoint = mapper.map(endpoint); + if (mappedEndpoint != null) { + provider = mappedEndpoint.getBindingProvider(); } } @@ -62,6 +62,8 @@ public class DelegatingSCAServiceBindingProvider implements ServiceBindingProvid return; } else { provider.start(); + // Set the resolved binding URI back to the binding.sca + endpoint.getBinding().setURI(mappedEndpoint.getBinding().getURI()); started = true; } } |