summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-10-31 10:34:23 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-10-31 10:34:23 +0000
commitb624b481d8900141f221c041858deea1aef04a71 (patch)
tree8ad7c06934083b7512e6aa52db8461c319772047 /sca-java-2.x/trunk/modules/core
parent51d1c4868bebe4f3b72ab2652178e058b0505ece (diff)
Add a spec version to Endpoint and only do full matching if the target endpoint is and OASIS endpoint
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1195400 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.java31
1 files changed, 30 insertions, 1 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 b0be5cb3e8..23d8f1a188 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
@@ -28,6 +28,7 @@ import java.util.logging.Logger;
import javax.xml.namespace.QName;
import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Base;
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.assembly.Callback;
import org.apache.tuscany.sca.assembly.ComponentReference;
@@ -647,6 +648,25 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
private boolean haveMatchingPolicy(EndpointReference endpointReference, Endpoint endpoint, Audit matchAudit, BuilderContext builderContext){
matchAudit.append("Match policy of " + endpointReference.toString() + " to " + endpoint.toString() + " ");
+ if (!endpoint.getSpecVersion().equals(Base.SCA11_NS)){
+ // the thing we need to check here is asyncInvocation as only OASIS supports that
+ if (endpointReference.isAsyncInvocation()){
+ // this definitely won't mactch anything but OASIS so fail
+ matchAudit.append("No match because the endpoint reference is configured for asyncInvocation " +
+ "and the target endpoint is not an OASIS endpoint, specVersion = " +
+ endpoint.getSpecVersion());
+ matchAudit.appendSeperator();
+ return false;
+ } else {
+ // Assume it matches as we don't know how to do policy
+ // matching with anything but OASIS endpoints
+ matchAudit.append("Match because the target endpoint is not an OASIS endpoint, specVersion = " +
+ endpoint.getSpecVersion());
+ matchAudit.appendSeperator();
+ return true;
+ }
+ }
+
List<PolicySet> referencePolicySets = new ArrayList<PolicySet>();
Binding binding = null;
@@ -1001,7 +1021,16 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
matchAudit.append("Match because there is no interface contract on the reference ");
matchAudit.appendSeperator();
return true;
- }
+ }
+
+ if (!endpoint.getSpecVersion().equals(Base.SCA11_NS)){
+ // Assume it matches as we don't know how to do policy
+ // matching with anything but OASIS endpoint
+ matchAudit.append("Match because the target endpoint is not an OASIS endpoint, specVersion = " +
+ endpoint.getSpecVersion());
+ matchAudit.appendSeperator();
+ return true;
+ }
/* For testing this code turns off remote interface matching completely
if (endpoint.isRemote()){