diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-23 13:04:42 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2012-03-23 13:04:42 +0000 |
commit | 49de8e6978a137718c71c99b00f4f48440f9e9ab (patch) | |
tree | 619dcaf30fe9468a82afdd0dfc640a69d2f70d01 /sca-java-2.x/trunk/modules/core | |
parent | 0bc82d8baa98f2bf9055837a3bf9bfdaf1b91991 (diff) |
TUSCANY-4033 - Don't generate WSDL when binding an EPR to a remote EP and the EPR and EP both use a Java interface.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1304327 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core')
-rw-r--r-- | sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java index f90dc2d1d9..4c4599709d 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java @@ -50,6 +50,8 @@ import org.apache.tuscany.sca.core.assembly.impl.RuntimeEndpointReferenceImpl; import org.apache.tuscany.sca.definitions.Definitions; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; +import org.apache.tuscany.sca.interfacedef.impl.TuscanyInterfaceContractImpl; +import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; import org.apache.tuscany.sca.interfacedef.util.Audit; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.MonitorFactory; @@ -1123,10 +1125,20 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder { return true; } - // If the contracts are not of the same type use normailized interfaces - if (endpointReferenceContract.getClass() != endpointContract.getClass() || + // TUSCANY-4033 + // Detect the case where the interfaces are both Java but the Endpoint is remote in which case + // we have to match the local Java interface with the remote Tuscany interface. But we can do this + // without running WSDLGen + if (endpointReferenceContract.getClass() == endpointContract.getClass() && + endpointReferenceContract instanceof JavaInterfaceContract && + endpointContract.getNormalizedWSDLContract() != null && + endpointContract.getNormalizedWSDLContract() instanceof TuscanyInterfaceContractImpl){ + // use the TuscanyInterfaceContractImpl to compare against the Java contract + endpointContract = endpointContract.getNormalizedWSDLContract(); + } else if (endpointReferenceContract.getClass() != endpointContract.getClass() || endpointReferenceContract.getNormalizedWSDLContract() != null || endpointContract.getNormalizedWSDLContract() != null) { + // If the contracts are not of the same type use normailized interfaces endpointReferenceContract = ((RuntimeEndpointReference)endpointReference).getGeneratedWSDLContract(endpointReferenceContract); endpointContract = ((RuntimeEndpoint)endpoint).getGeneratedWSDLContract(endpointContract); } |