summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java11
-rw-r--r--sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DelegatingSCAServiceBindingProvider.java14
-rw-r--r--sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java7
-rw-r--r--sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java15
4 files changed, 24 insertions, 23 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;
}
}
diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java
index f3813672c3..5772360575 100644
--- a/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java
+++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/provider/Axis2ServiceBindingProvider.java
@@ -24,15 +24,11 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.wsdl.Port;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.extensions.soap12.SOAP12Address;
-import javax.xml.namespace.QName;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.description.TransportInDescription;
@@ -45,11 +41,9 @@ import org.apache.tuscany.sca.assembly.xml.Constants;
import org.apache.tuscany.sca.binding.ws.WebServiceBinding;
import org.apache.tuscany.sca.binding.ws.axis2.policy.mtom.Axis2MTOMPolicyProvider;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.core.assembly.RuntimeAssemblyFactory;
import org.apache.tuscany.sca.host.http.ServletHost;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.invocation.MessageFactory;
import org.apache.tuscany.sca.policy.util.PolicyHelper;
import org.apache.tuscany.sca.provider.PolicyProvider;
import org.apache.tuscany.sca.provider.ServiceBindingProvider;
@@ -169,6 +163,7 @@ public class Axis2ServiceBindingProvider extends Axis2BaseBindingProvider implem
if (isJMSRequired){
// TODO - do we need to go back to configurator?
}
+ wsBinding.setURI(endpointURI);
}
private static final String DEFAULT_QUEUE_CONNECTION_FACTORY = "TuscanyQueueConnectionFactory";
diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java
index 42da4abed7..4c5bca204b 100644
--- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java
+++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/BindingURIBuilderImpl.java
@@ -31,6 +31,7 @@ import org.apache.tuscany.sca.assembly.Component;
import org.apache.tuscany.sca.assembly.ComponentService;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.SCABinding;
import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.assembly.builder.BuilderContext;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
@@ -195,6 +196,10 @@ public class BindingURIBuilderImpl implements CompositeBuilder {
// calculate the service binding URI
URI bindingURI = binding.getURI() == null ? null : new URI(binding.getURI());
+ if (binding instanceof SCABinding) {
+ // Per assembly spec, the @uri for service side binding.sca should be ignored
+ bindingURI = null;
+ }
// if the user has provided an absolute binding URI then use it
if (bindingURI != null && bindingURI.isAbsolute()) {
@@ -218,10 +223,12 @@ public class BindingURIBuilderImpl implements CompositeBuilder {
// calculate the base URI
URI baseURI = null;
- if (defaultBindings != null) {
- List<String> uris = defaultBindings.get(binding.getType());
- if (uris != null && uris.size() > 0) {
- baseURI = new URI(addSlashToPath(uris.get(0)));
+ if (!(binding instanceof SCABinding)) {
+ if (defaultBindings != null) {
+ List<String> uris = defaultBindings.get(binding.getType());
+ if (uris != null && uris.size() > 0) {
+ baseURI = new URI(addSlashToPath(uris.get(0)));
+ }
}
}