tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r616276 - /incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java
Date Tue, 29 Jan 2008 12:05:14 GMT
Author: antelder
Date: Tue Jan 29 04:05:13 2008
New Revision: 616276

URL: http://svn.apache.org/viewvc?rev=616276&view=rev
Log:
TUSCANY-1674, Missing NonBlockingInterceptor on service wire, thanks to Scott, Rashmi, and
Giorgio for participating in the fix

Modified:
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java?rev=616276&r1=616275&r2=616276&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java
Tue Jan 29 04:05:13 2008
@@ -41,6 +41,7 @@
 import org.apache.tuscany.sca.invocation.MessageFactory;
 import org.apache.tuscany.sca.provider.ImplementationProvider;
 import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
 import org.apache.tuscany.sca.runtime.EndpointReference;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
@@ -166,6 +167,7 @@
             // It's the service wire
             RuntimeComponentService service = (RuntimeComponentService)wireTarget.getContract();
             RuntimeComponent serviceComponent = wireTarget.getComponent();
+            Binding serviceBinding = wireTarget.getBinding();
             for (Operation operation : sourceContract.getInterface().getOperations()) {
                 Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(),
operation);
                 if (targetOperation == null) {
@@ -176,6 +178,9 @@
                         + service.getName());
                 }
                 InvocationChain chain = new InvocationChainImpl(operation, targetOperation);
+                if (operation.isNonBlocking()) {
+                    addNonBlockingInterceptor(service, serviceBinding, chain);
+                }
                 addImplementationInterceptor(serviceComponent, service, chain, targetOperation);
                 chains.add(chain);
             }
@@ -244,6 +249,22 @@
         }
     }
 
+    /**
+     * Add a non-blocking interceptor if the service binding needs it
+     *
+     * @param service
+     * @param binding
+     * @param chain
+     */
+    private void addNonBlockingInterceptor(ComponentService service, Binding binding, InvocationChain
chain) {
+        ServiceBindingProvider provider = ((RuntimeComponentService)service).getBindingProvider(binding);
+        if (provider != null) {
+            if (!provider.supportsOneWayInvocation()) {
+                chain.addInterceptor(new NonBlockingInterceptor(workScheduler));
+            }
+        }
+    }
+ 
     /**
      * Add the interceptor for a component implementation
      * 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message