You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2008/09/08 11:47:19 UTC

svn commit: r693038 - /servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiBinding.java

Author: ffang
Date: Mon Sep  8 02:47:18 2008
New Revision: 693038

URL: http://svn.apache.org/viewvc?rev=693038&view=rev
Log:
[SM-1540]exclude Map or Collection property as well which entry may not be serializable

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiBinding.java

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiBinding.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiBinding.java?rev=693038&r1=693037&r2=693038&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiBinding.java (original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiBinding.java Mon Sep  8 02:47:18 2008
@@ -20,6 +20,7 @@
 import java.io.StringReader;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
 
@@ -154,7 +155,11 @@
     protected void addJbiHeaders(MessageExchange jbiExchange, NormalizedMessage normalizedMessage, Exchange camelExchange) {
         Set<Map.Entry<String, Object>> entries = camelExchange.getIn().getHeaders().entrySet();
         for (Map.Entry<String, Object> entry : entries) {
-            if (entry.getValue() instanceof Serializable) {
+            //check if value is Serializable, and if value is Map or collection,
+            //just exclude it since the entry of it may not be Serializable as well
+            if (entry.getValue() instanceof Serializable 
+                    && !(entry.getValue() instanceof Map)
+                    && !(entry.getValue() instanceof Collection)) {
                 normalizedMessage.setProperty(entry.getKey(), entry.getValue());
             }
         }