tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1195400 - in /tuscany/sca-java-2.x/trunk/modules: assembly/src/main/java/org/apache/tuscany/sca/assembly/ assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba...
Date Mon, 31 Oct 2011 10:34:24 GMT
Author: slaws
Date: Mon Oct 31 10:34:23 2011
New Revision: 1195400

URL: http://svn.apache.org/viewvc?rev=1195400&view=rev
Log:
Add a spec version to Endpoint and only do full matching if the target endpoint is and OASIS
endpoint

Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
    tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
    tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
    tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java?rev=1195400&r1=1195399&r2=1195400&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Endpoint.java
Mon Oct 31 10:34:23 2011
@@ -34,6 +34,7 @@ import org.apache.tuscany.sca.policy.Pol
  * @tuscany.spi.extension.asclient
  */
 public interface Endpoint extends Base, PolicySubject, Cloneable, Serializable {
+    
     /**
      * Get the structural URI of the service binding
      * @return structural URI of the service/binding
@@ -156,4 +157,23 @@ public interface Endpoint extends Base, 
      */
     boolean isAsyncInvocation();    
     
+    /** 
+     * Get the spec version for this endpoint. This is intended to help 
+     * interop scenarios where having an OASIS endpoint talk to an 
+     * OSOA endpoint implies some restrictions. 
+     * 
+     * @return the spec version, namespace for either SCA-1.0 or SCA-1.1 
+     */
+    String getSpecVersion();
+    
+    /** 
+     * Set the spec version for this endpoint. This is intended to help 
+     * interop scenarios where having an OASIS endpoint talk to an 
+     * OSOA endpoint implies some restrictions. If unset it defaults
+     * to the namespace for SCA-1.1
+     * 
+     * @param specVersion the spec version, namspace for either SCA-1.0 or SCA-1.1
+     */    
+    void setSpecVersion(String specVersion);
+    
 }

Modified: tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java?rev=1195400&r1=1195399&r2=1195400&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/EndpointImpl.java
Mon Oct 31 10:34:23 2011
@@ -21,6 +21,7 @@ package org.apache.tuscany.sca.assembly.
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.tuscany.sca.assembly.Base;
 import org.apache.tuscany.sca.assembly.Binding;
 import org.apache.tuscany.sca.assembly.Component;
 import org.apache.tuscany.sca.assembly.ComponentService;
@@ -57,6 +58,7 @@ public class EndpointImpl implements End
     protected List<PolicySet> policySets = new ArrayList<PolicySet>();
     protected List<Intent> requiredIntents = new ArrayList<Intent>();
     protected boolean remote = false;
+    protected String specVersion = Base.SCA11_NS; 
 
     protected EndpointImpl(ExtensionPointRegistry registry) {
         this.registry = registry;
@@ -305,5 +307,15 @@ public class EndpointImpl implements End
     public void setDeployedURI(String deployedURI) {
         this.deployedURI = deployedURI;
     }
+    
+    @Override
+    public String getSpecVersion() {
+        return specVersion;
+    }
+    
+    @Override
+    public void setSpecVersion(String specVersion){
+        this.specVersion = specVersion;
+    }
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java?rev=1195400&r1=1195399&r2=1195400&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
Mon Oct 31 10:34:23 2011
@@ -365,4 +365,16 @@ public class TestRuntimeWire implements 
         // TODO Auto-generated method stub
         
     }
+    
+    @Override
+    public String getSpecVersion() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+    
+    @Override
+    public void setSpecVersion(String specVersion) {
+        // TODO Auto-generated method stub
+        
+    }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java?rev=1195400&r1=1195399&r2=1195400&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Mon Oct 31 10:34:23 2011
@@ -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
     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
             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()){



Mime
View raw message