tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r1173364 - in /tuscany/sca-java-2.x/trunk: modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java testing/itest/scabindingmapper/src/main/java/itest/scabindingmapper/MyMapper.java
Date Tue, 20 Sep 2011 20:55:39 GMT
Author: rfeng
Date: Tue Sep 20 20:55:39 2011
New Revision: 1173364

URL: http://svn.apache.org/viewvc?rev=1173364&view=rev
Log:
Allows the distributed flag to be overriden

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java
    tuscany/sca-java-2.x/trunk/testing/itest/scabindingmapper/src/main/java/itest/scabindingmapper/MyMapper.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java?rev=1173364&r1=1173363&r2=1173364&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java
Tue Sep 20 20:55:39 2011
@@ -60,7 +60,7 @@ public class DefaultSCABindingMapper imp
     protected StAXArtifactProcessorExtensionPoint processors;
     protected QName defaultMappedBinding;
     protected QName defaultLocalBinding;
-    // protected boolean supportsDistributedSCA;
+    protected boolean alwaysDistributed;
 
     public DefaultSCABindingMapper(ExtensionPointRegistry registry, Map<String, String>
attributes) {
         this.registry = registry;
@@ -68,7 +68,9 @@ public class DefaultSCABindingMapper imp
         processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
         defaultMappedBinding = getDefaultMappedBinding(attributes);
         defaultLocalBinding = new QName(Base.SCA11_TUSCANY_NS, "binding.local");
-        // supportsDistributedSCA = isDistributed();
+        if (attributes != null && "true".equalsIgnoreCase(attributes.get("alwaysDistributed")))
{
+            alwaysDistributed = true;
+        }
     }
 
     protected QName getDefaultMappedBinding(Map<String, String> attributes) {
@@ -246,7 +248,7 @@ public class DefaultSCABindingMapper imp
      */
     protected QName chooseBinding(RuntimeEndpoint endpoint) {
         DomainRegistry domainRegistry = endpoint.getCompositeContext().getEndpointRegistry();
-        boolean distributed = domainRegistry.isDistributed();
+        boolean distributed = alwaysDistributed || domainRegistry.isDistributed();
         InterfaceContract interfaceContract = endpoint.getService().getInterfaceContract();
         if(interfaceContract != null
            && interfaceContract.getInterface() != null
@@ -266,7 +268,7 @@ public class DefaultSCABindingMapper imp
      */
     protected QName chooseBinding(RuntimeEndpointReference endpointReference) {
         DomainRegistry domainRegistry = endpointReference.getCompositeContext().getEndpointRegistry();
-        boolean distributed = domainRegistry.isDistributed();
+        boolean distributed = alwaysDistributed || domainRegistry.isDistributed();
         if(endpointReference.getTargetEndpoint().isRemote()) {
             RuntimeComponentReference ref = (RuntimeComponentReference)endpointReference.getReference();
             if(ref.getInterfaceContract() != null && !ref.getInterfaceContract().getInterface().isRemotable())
{

Modified: tuscany/sca-java-2.x/trunk/testing/itest/scabindingmapper/src/main/java/itest/scabindingmapper/MyMapper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/scabindingmapper/src/main/java/itest/scabindingmapper/MyMapper.java?rev=1173364&r1=1173363&r2=1173364&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/scabindingmapper/src/main/java/itest/scabindingmapper/MyMapper.java
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/scabindingmapper/src/main/java/itest/scabindingmapper/MyMapper.java
Tue Sep 20 20:55:39 2011
@@ -38,6 +38,7 @@ public class MyMapper extends DefaultSCA
 
     public MyMapper(ExtensionPointRegistry registry, Map<String, String> attributes)
{
         super(registry, attributes);
+        alwaysDistributed = true;
     }
 
     @Override
@@ -68,13 +69,4 @@ public class MyMapper extends DefaultSCA
         return bindingType;
     }
 
-    /*
-     * Probably others don't need to override this is they have a remotable endpoint registry,
this itest
-     * doesn't so just fiddle the test  
-     */
-    @Override
-    protected boolean isDistributed() {
-        return true;
-    }
-
 }



Mime
View raw message