servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r790496 - /servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
Date Thu, 02 Jul 2009 08:29:04 GMT
Author: ffang
Date: Thu Jul  2 08:29:04 2009
New Revision: 790496

URL: http://svn.apache.org/viewvc?rev=790496&view=rev
Log:
[SMXCOMP-577]servicemix camel can't deal with the message have the security subject rightly

Modified:
    servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java

Modified: servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java?rev=790496&r1=790495&r2=790496&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
(original)
+++ servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
Thu Jul  2 08:29:04 2009
@@ -84,10 +84,12 @@
         normalizedMessage.setContent(getJbiInContent(camelExchange));
         addJbiHeaders(jbiExchange, normalizedMessage, camelExchange.getIn());
         addJbiAttachments(jbiExchange, normalizedMessage, camelExchange);
+        addSecuritySubject(jbiExchange, normalizedMessage, camelExchange.getIn());
         return jbiExchange;
     }
+    
 
-    // Properties
+	// Properties
     // -------------------------------------------------------------------------
 
     public String getMessageExchangePattern() {
@@ -188,6 +190,18 @@
             copyNormalizedMessageHeaders(normalizedMessage, camelNormalizedMessage);
         }
     }
+    
+    protected void addSecuritySubject(MessageExchange jbiExchange,
+			NormalizedMessage normalizedMessage, Message camelMessage) {
+    	if (camelMessage instanceof JbiMessage) {
+    		JbiMessage message = (JbiMessage) camelMessage;
+    		if (message.getNormalizedMessage() != null) {
+    			// copy the security subject
+    			normalizedMessage.setSecuritySubject(message.getNormalizedMessage().getSecuritySubject());
+    		}
+    	}	
+		
+	}
 
     @SuppressWarnings("unchecked")
     private void copyNormalizedMessageHeaders(NormalizedMessage from, NormalizedMessage to)
{



Mime
View raw message