diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-01-06 12:35:01 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-01-06 12:35:01 +0000 |
commit | 31f71e8e078644469dd2ed93d5873fc1050062e4 (patch) | |
tree | 4b1cf757ba3437e4206a8ba6f06602ee87ec837f /sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany | |
parent | d0e15154ff66a8422425259d0b3b3a776a004cd5 (diff) |
TUSCANY-3932 - First part of this JIRA is to remove some inconsistencies in the way that callbacks are handled now. See JIRA for more comments on this first change.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1228150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany')
2 files changed, 21 insertions, 2 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 6f843ff2d6..b8a70f0ba1 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 @@ -29,9 +29,11 @@ import javax.xml.stream.XMLStreamReader; import org.apache.tuscany.sca.assembly.Base; import org.apache.tuscany.sca.assembly.Binding; +import org.apache.tuscany.sca.assembly.SCABinding; import org.apache.tuscany.sca.assembly.builder.BindingBuilder; import org.apache.tuscany.sca.assembly.builder.BuilderContext; import org.apache.tuscany.sca.assembly.builder.BuilderExtensionPoint; +import org.apache.tuscany.sca.assembly.xml.Constants; import org.apache.tuscany.sca.common.xml.stax.StAXHelper; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ProcessorContext; @@ -61,6 +63,10 @@ public class DefaultSCABindingMapper implements SCABindingMapper { protected QName defaultMappedBinding; protected QName defaultLocalBinding; protected boolean alwaysDistributed; + + // Test to look at supporting concurrent binding.sca delegations + protected QName [] activeDelegations = {new QName(Base.SCA11_TUSCANY_NS, "binding.local"), + new QName(Base.SCA11_NS, "binding.ws")}; public DefaultSCABindingMapper(ExtensionPointRegistry registry, Map<String, String> attributes) { this.registry = registry; @@ -196,7 +202,14 @@ public class DefaultSCABindingMapper implements SCABindingMapper { try { Binding binding = createDelegatingBinding(newBindingType); binding.setName(scaBinding.getName()); - binding.setURI(scaBinding.getURI()); + if (((SCABinding)scaBinding).getDelegateBindingURI() != null){ + // if this is an SCA binding that's been resolved via the registry then + // the URI of the target service is delegate specific and is stored + // in this new slot in the binding model + binding.setURI(((SCABinding)scaBinding).getDelegateBindingURI()); + } else { + binding.setURI(scaBinding.getURI()); + } binding.setOperationSelector(scaBinding.getOperationSelector()); binding.setRequestWireFormat(scaBinding.getRequestWireFormat()); binding.setResponseWireFormat(scaBinding.getResponseWireFormat()); @@ -285,5 +298,9 @@ public class DefaultSCABindingMapper implements SCABindingMapper { return defaultLocalBinding; } + + public QName[] getActiveDelegations(){ + return activeDelegations; + } } 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 bc57c47ba6..319661d7bb 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 @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.binding.sca.provider; +import org.apache.tuscany.sca.assembly.SCABinding; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.invocation.InvokerAsyncResponse; import org.apache.tuscany.sca.provider.EndpointAsyncProvider; @@ -94,7 +95,8 @@ public class DelegatingSCAServiceBindingProvider implements EndpointAsyncProvide } else { provider.start(); // Set the resolved binding URI back to the binding.sca - endpoint.getBinding().setURI(delegateEndpoint.getBinding().getURI()); + ((SCABinding)endpoint.getBinding()).setDelegateBindingType(delegateEndpoint.getBinding().getType().toString()); + ((SCABinding)endpoint.getBinding()).setDelegateBindingURI(delegateEndpoint.getBinding().getURI()); endpoint.setDeployedURI(delegateEndpoint.getDeployedURI()); started = true; } |