Author: rfeng
Date: Wed Dec  6 11:55:56 2006
New Revision: 483203

URL: http://svn.apache.org/viewvc?view=rev&rev=483203
Log:
Make sure not to reset the body for immutable messages

Modified:
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/NonBlockingBridgingInterceptor.java

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java?view=diff&rev=483203&r1=483202&r2=483203
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java
 Wed Dec  6 11:55:56 2006
@@ -75,6 +75,10 @@
             // throw new InvocationRuntimeException((Throwable) result);
             return resultMsg;
         } else {
+            if (sourceOperation.isNonBlocking()) {
+                // Not to reset the message body
+                return resultMsg;
+            }
             // FIXME: Should we fix the Operation model so that getOutputType 
returns DataType<DataType<T>>?
             DataType<DataType> targetType =
                 new DataType<DataType>("idl:output", Object.class, 
targetOperation.getOutputType());
@@ -84,8 +88,10 @@
                 new DataType<DataType>("idl:output", Object.class, 
sourceOperation.getOutputType());
             
sourceType.setOperation(sourceOperation.getOutputType().getOperation());
 
-            result = transform(result, targetType, sourceType);
-            resultMsg.setBody(result);
+            Object newResult = transform(result, targetType, sourceType);
+            if (newResult != result) {
+                resultMsg.setBody(newResult);
+            }
         }
         return resultMsg;
     }

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/NonBlockingBridgingInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/NonBlockingBridgingInterceptor.java?view=diff&rev=483203&r1=483202&r2=483203
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/NonBlockingBridgingInterceptor.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/NonBlockingBridgingInterceptor.java
 Wed Dec  6 11:55:56 2006
@@ -128,7 +128,9 @@
         }
 
         public void setBody(Object body) {
-            throw new UnsupportedOperationException();
+            if (body != null) {
+                throw new UnsupportedOperationException();
+            }
         }
 
         public void setTargetInvoker(TargetInvoker invoker) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to