cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ulhasbh...@apache.org
Subject svn commit: r696721 - in /cxf/branches/2.1.x-fixes: ./ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/
Date Thu, 18 Sep 2008 17:13:06 GMT
Author: ulhasbhole
Date: Thu Sep 18 10:13:06 2008
New Revision: 696721

URL: http://svn.apache.org/viewvc?rev=696721&view=rev
Log:
Merged revisions 696720 via svnmerge from 
https://svn.eu.apache.org/repos/asf/cxf/trunk

........
  r696720 | ulhasbhole | 2008-09-18 18:10:28 +0100 (Thu, 18 Sep 2008) | 1 line
  
  * [CXF-1805] Use of Content-Type in JMS Header not in line with JMS specification
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 18 10:13:06 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433,696720

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java?rev=696721&r1=696720&r2=696721&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
Thu Sep 18 10:13:06 2008
@@ -21,6 +21,7 @@
 
 public final class JMSConstants {
     
+    public static final String JMS_CONTENT_TYPE = "SOAPJMS_contentType";
     public static final String JMS_QUEUE = "queue";
     public static final String JMS_TOPIC = "topic";
 

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?rev=696721&r1=696720&r2=696721&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
Thu Sep 18 10:13:06 2008
@@ -212,7 +212,9 @@
             props.add(prop);
 
             protHeaders.put(name, Collections.singletonList(val));
-            if (name.equals(org.apache.cxf.message.Message.CONTENT_TYPE) && val !=
null) {
+            if (name.equals(org.apache.cxf.message.Message.CONTENT_TYPE)
+                || name.equals(JMSConstants.JMS_CONTENT_TYPE) 
+                && val != null) {
                 inMessage.put(org.apache.cxf.message.Message.CONTENT_TYPE, val);
             }
 
@@ -237,7 +239,13 @@
                 value.append(s);
                 first = false;
             }
-            message.setStringProperty(entry.getKey(), value.toString());
+            //Incase if the Content-Type header key is Content-Type replace with JMS_Content_Type
+            if (entry.getKey().equals(org.apache.cxf.message.Message.CONTENT_TYPE)) {
+                message.setStringProperty(JMSConstants.JMS_CONTENT_TYPE, value.toString());
+            } else {
+                message.setStringProperty(entry.getKey(), value.toString());    
+            }
+            
         }
     }
 
@@ -255,14 +263,17 @@
         String contentType = (String)message.get(org.apache.cxf.message.Message.CONTENT_TYPE);
 
         Map<String, List<String>> headers = JMSUtils.getSetProtocolHeaders(message);
-        if (headers.get(org.apache.cxf.message.Message.CONTENT_TYPE) == null) {
-            List<String> ct = new ArrayList<String>();
-            ct.add(contentType);
-            headers.put(org.apache.cxf.message.Message.CONTENT_TYPE, ct);
+        List<String> ct;
+        if (headers.get(JMSConstants.JMS_CONTENT_TYPE) != null) {
+            ct = headers.get(JMSConstants.JMS_CONTENT_TYPE);
+        } else if (headers.get(org.apache.cxf.message.Message.CONTENT_TYPE) != null) {
+            ct = headers.get(org.apache.cxf.message.Message.CONTENT_TYPE);
         } else {
-            List<String> ct = headers.get(org.apache.cxf.message.Message.CONTENT_TYPE);
-            ct.add(contentType);
+            ct = new ArrayList<String>();
+            headers.put(JMSConstants.JMS_CONTENT_TYPE, ct);
         }
+        
+        ct.add(contentType);
     }
 
     public static boolean isDestinationStyleQueue(AddressType address) {

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?rev=696721&r1=696720&r2=696721&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
Thu Sep 18 10:13:06 2008
@@ -389,8 +389,8 @@
 
         assertTrue("property has been excluded, only CONTENT_TYPE should be here",
                 inHeader.getProperty().size() == 1);
-        assertTrue("property has been excluded, only CONTENT_TYPE should be here",
-                inHeader.getProperty().get(0).getName().equals(Message.CONTENT_TYPE));
+        assertTrue("property has been excluded, only " + JMSConstants.JMS_CONTENT_TYPE +
"should be here",
+                inHeader.getProperty().get(0).getName().equals(JMSConstants.JMS_CONTENT_TYPE));
         // wait for a while for the jms session recycling
         Thread.sleep(1000);
         destination.shutdown();



Mime
View raw message