cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [2/2] cxf git commit: Refactoring in jms transport to implement properties as map
Date Thu, 27 Apr 2017 15:14:17 GMT
Refactoring in jms transport to implement properties as map


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0a4d2676
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0a4d2676
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0a4d2676

Branch: refs/heads/master
Commit: 0a4d26766122177fe1a919ae1e00bb1d93712c6f
Parents: 6070dde
Author: Christian Schneider <chris@die-schneider.net>
Authored: Thu Apr 27 17:07:08 2017 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Thu Apr 27 17:14:12 2017 +0200

----------------------------------------------------------------------
 .../java/demo/jms_greeter/client/Client.java    |   6 +-
 .../apache/cxf/transport/jms/JMSConstants.java  |  18 +-
 .../transport/jms/JMSMessageHeadersType.java    | 212 +++++++++++----
 .../cxf/transport/jms/JMSMessageUtils.java      | 255 +++++--------------
 .../cxf/transport/jms/JMSPropertyType.java      |  38 +--
 .../transport/jms/spec/JMSSpecConstants.java    |   5 +-
 .../cxf/transport/jms/JMSDestinationTest.java   |   3 +-
 .../cxf/systest/jms/JMSClientServerTest.java    |  15 +-
 .../cxf/systest/jms/TwoWayJMSImplBase.java      |   3 +-
 .../systest/jms/security/TwoWayJMSImplBase.java |   7 +-
 10 files changed, 255 insertions(+), 307 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/distribution/src/main/release/samples/jms_queue/src/main/java/demo/jms_greeter/client/Client.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jms_queue/src/main/java/demo/jms_greeter/client/Client.java b/distribution/src/main/release/samples/jms_queue/src/main/java/demo/jms_greeter/client/Client.java
index 8764e2c..717afb4 100644
--- a/distribution/src/main/release/samples/jms_queue/src/main/java/demo/jms_greeter/client/Client.java
+++ b/distribution/src/main/release/samples/jms_queue/src/main/java/demo/jms_greeter/client/Client.java
@@ -31,8 +31,6 @@ import javax.xml.ws.BindingProvider;
 import org.apache.cxf.jms_greeter.JMSGreeterPortType;
 import org.apache.cxf.jms_greeter.JMSGreeterService;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
-import org.apache.cxf.transport.jms.JMSPropertyType;
-
 
 public final class Client {
 
@@ -85,7 +83,7 @@ public final class Client {
             JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
             requestHeader.setJMSCorrelationID("JMS_QUEUE_SAMPLE_CORRELATION_ID");
             requestHeader.setJMSExpiration(3600000L);
-            requestHeader.getProperty().add(new JMSPropertyType("Test.Prop", "mustReturn"));
+            requestHeader.putProperty("Test.Prop", "mustReturn");
             requestContext.put("org.apache.cxf.jms.client.request.headers", requestHeader);
             //To override the default receive timeout.
             requestContext.put("org.apache.cxf.jms.client.timeout", new Long(1000));
@@ -105,7 +103,7 @@ public final class Client {
             }
 
             if ("JMS_QUEUE_SAMPLE_CORRELATION_ID".equals(responseHdr.getJMSCorrelationID())
-                && responseHdr.getProperty() != null) {
+                && !responseHdr.getPropertyKeys().isEmpty()) {
                 System.out.println("Received expected contents in response context");
             } else {
                 System.out.println("Received wrong contents in response context");

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
index 4d33f74..63fe389 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConstants.java
@@ -21,43 +21,59 @@ package org.apache.cxf.transport.jms;
 
 public final class JMSConstants {
 
+    @Deprecated
     public static final String JMS_CONTENT_TYPE = "SOAPJMS_contentType";
+    
+    @Deprecated
     public static final String JMS_QUEUE = "queue";
+    @Deprecated
     public static final String JMS_TOPIC = "topic";
 
     public static final String TEXT_MESSAGE_TYPE = "text";
     public static final String BINARY_MESSAGE_TYPE = "binary";
     public static final String BYTE_MESSAGE_TYPE = "byte";
 
+    @Deprecated
     public static final String JMS_POOLEDSESSION = "jms.pooled.session";
     public static final String JMS_SERVER_REQUEST_HEADERS = "org.apache.cxf.jms.server.request.headers";
     public static final String JMS_SERVER_RESPONSE_HEADERS = "org.apache.cxf.jms.server.response.headers";
     public static final String JMS_REQUEST_MESSAGE = "org.apache.cxf.jms.request.message";
+    @Deprecated
     public static final String JMS_RESPONSE_MESSAGE = "org.apache.cxf.jms.reponse.message";
     public static final String JMS_CLIENT_REQUEST_HEADERS = "org.apache.cxf.jms.client.request.headers";
     public static final String JMS_CLIENT_RESPONSE_HEADERS =
         "org.apache.cxf.jms.client.response.headers";
 
+    @Deprecated
     public static final String JMS_CLIENT_RECEIVE_TIMEOUT = "org.apache.cxf.jms.client.timeout";
 
+    @Deprecated
     public static final String JMS_SERVER_CONFIGURATION_URI =
         "http://cxf.apache.org/configuration/transport/jms-server";
+    @Deprecated
     public static final String JMS_CLIENT_CONFIGURATION_URI =
         "http://cxf.apache.org/configuration/transport/jms-client";
+    @Deprecated
     public static final String ENDPOINT_CONFIGURATION_URI =
         "http://cxf.apache.org/jaxws/endpoint-config";
+    @Deprecated
     public static final String SERVICE_CONFIGURATION_URI =
         "http://cxf.apache.org/jaxws/service-config";
+    @Deprecated
     public static final String PORT_CONFIGURATION_URI =
         "http://cxf.apache.org/jaxws/port-config";
 
+    @Deprecated
     public static final String JMS_CLIENT_CONFIG_ID = "jms-client";
+    @Deprecated
     public static final String JMS_SERVER_CONFIG_ID = "jms-server";
 
     // Is used by WS-Addressing
     public static final String JMS_REBASED_REPLY_TO = "org.apache.cxf.jms.server.replyto";
     public static final String JMS_SET_REPLY_TO = "org.apache.cxf.jms.client.set.replyto";
-
+    public static final String JMS_MESSAGE_TYPE = "JMSMessageType";
+    public static final String TARGET_SERVICE_IN_REQUESTURI = "target.service.inrequesturi";
+    public static final String MALFORMED_REQUESTURI = "malformed.requesturi";
 
     private JMSConstants() {
         //utility class

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageHeadersType.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageHeadersType.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageHeadersType.java
index 333f582..9fcafba 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageHeadersType.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageHeadersType.java
@@ -19,49 +19,70 @@
 package org.apache.cxf.transport.jms;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
+import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.Topic;
 
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
 
-//CHECKSTYLE:OFF
 public class JMSMessageHeadersType {
-    protected List<JMSPropertyType> property;
-    protected String jmsCorrelationID;
-    protected Integer jmsDeliveryMode;
-    protected Long jmsExpiration;
-    protected String jmsMessageID;
-    protected Integer jmsPriority;
-    protected Boolean jmsRedelivered;
-    protected String jmsReplyTo;
-    protected Long jmsTimeStamp;
-    protected String jmsType;
-    protected Long timeToLive;
-    protected String soapjmsTargetService;
-    protected String soapjmsBindingVersion;
-    protected String soapjmsContentType;
-    protected String soapjmsContentEncoding;
-    protected String soapjmssoapAction;
-    protected Boolean soapjmsIsFault;
-    protected String soapjmsRequestURI;
-
+    private Map<String, Object> properties;
+    private String jmsCorrelationID;
+    private Integer jmsDeliveryMode;
+    private Long jmsExpiration;
+    private String jmsMessageID;
+    private Integer jmsPriority;
+    private Boolean jmsRedelivered;
+    private String jmsReplyTo;
+    private Long jmsTimeStamp;
+    private String jmsType;
+    private Long timeToLive;
+    private String soapjmsTargetService;
+    private String soapjmsBindingVersion;
+    private String soapjmsContentType;
+    private String soapjmsContentEncoding;
+    private String soapjmssoapAction;
+    private Boolean soapjmsIsFault;
+    private String soapjmsRequestURI;
+    
+    public JMSMessageHeadersType() {
+        this.properties = new HashMap<>();
+    }
+    
+    @Deprecated
     public List<JMSPropertyType> getProperty() {
-        if (property == null) {
-            property = new ArrayList<>();
+        List<JMSPropertyType> props = new ArrayList<>();
+        for (String key : properties.keySet()) {
+            JMSPropertyType prop = new JMSPropertyType();
+            prop.setName(key);
+            prop.setValue(properties.get(key));
+            props.add(prop);
         }
-        return this.property;
+        return Collections.unmodifiableList(props);
     }
-
-    public boolean isSetProperty() {
-        return ((this.property != null) && (!this.property.isEmpty()));
+    
+    public void putProperty(String key, Object value) {
+        properties.put(key, value);
     }
-
-    public void unsetProperty() {
-        this.property = null;
+    
+    public Object getProperty(String key) {
+        return properties.get(key);
     }
-
+    
+    public Set<String> getPropertyKeys() {
+        return properties.keySet();
+    }
+    
     public String getJMSCorrelationID() {
         return jmsCorrelationID;
     }
@@ -71,7 +92,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSCorrelationID() {
-        return (this.jmsCorrelationID != null);
+        return this.jmsCorrelationID != null;
     }
 
     public String getJMSMessageID() {
@@ -83,7 +104,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSMessageID() {
-        return (this.jmsMessageID != null);
+        return this.jmsMessageID != null;
     }
 
     public String getJMSReplyTo() {
@@ -95,7 +116,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSReplyTo() {
-        return (this.jmsReplyTo != null);
+        return this.jmsReplyTo != null;
     }
 
     public String getJMSType() {
@@ -107,7 +128,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSType() {
-        return (this.jmsType != null);
+        return this.jmsType != null;
     }
 
     public String getSOAPJMSTargetService() {
@@ -119,7 +140,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetSOAPJMSTargetService() {
-        return (this.soapjmsTargetService != null);
+        return this.soapjmsTargetService != null;
     }
 
     public String getSOAPJMSBindingVersion() {
@@ -131,7 +152,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetSOAPJMSBindingVersion() {
-        return (this.soapjmsBindingVersion != null);
+        return this.soapjmsBindingVersion != null;
     }
 
     public String getSOAPJMSContentType() {
@@ -143,7 +164,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetSOAPJMSContentType() {
-        return (this.soapjmsContentType != null);
+        return this.soapjmsContentType != null;
     }
 
     public String getSOAPJMSContentEncoding() {
@@ -155,7 +176,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetSOAPJMSContentEncoding() {
-        return (this.soapjmsContentEncoding != null);
+        return this.soapjmsContentEncoding != null;
     }
 
     public String getSOAPJMSSOAPAction() {
@@ -167,7 +188,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetSOAPJMSSOAPAction() {
-        return (this.soapjmssoapAction != null);
+        return this.soapjmssoapAction != null;
     }
 
     public String getSOAPJMSRequestURI() {
@@ -179,7 +200,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetSOAPJMSRequestURI() {
-        return (this.soapjmsRequestURI != null);
+        return this.soapjmsRequestURI != null;
     }
 
     public void setJMSDeliveryMode(int value) {
@@ -191,7 +212,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSDeliveryMode() {
-        return (this.jmsDeliveryMode != null);
+        return this.jmsDeliveryMode != null;
     }
 
     public int getJMSDeliveryMode() {
@@ -207,7 +228,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSExpiration() {
-        return (this.jmsExpiration != null);
+        return this.jmsExpiration != null;
     }
 
     public long getJMSExpiration() {
@@ -223,7 +244,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSPriority() {
-        return (this.jmsPriority != null);
+        return this.jmsPriority != null;
     }
 
     public int getJMSPriority() {
@@ -239,7 +260,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSRedelivered() {
-        return (this.jmsRedelivered != null);
+        return this.jmsRedelivered != null;
     }
 
     public boolean isJMSRedelivered() {
@@ -255,7 +276,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetJMSTimeStamp() {
-        return (this.jmsTimeStamp != null);
+        return this.jmsTimeStamp != null;
     }
 
     public long getJMSTimeStamp() {
@@ -271,7 +292,7 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetTimeToLive() {
-        return (this.timeToLive != null);
+        return this.timeToLive != null;
     }
 
     public long getTimeToLive() {
@@ -287,12 +308,98 @@ public class JMSMessageHeadersType {
     }
 
     public boolean isSetSOAPJMSIsFault() {
-        return (this.soapjmsIsFault != null);
+        return this.soapjmsIsFault != null;
     }
 
     public boolean isSOAPJMSIsFault() {
         return soapjmsIsFault;
     }
+    
+    public String getContentType() {
+        String contentType = getSOAPJMSContentType();
+        if (contentType == null) {
+            contentType = (String)getProperty(JMSSpecConstants.CONTENTTYPE_FIELD);
+        }
+        if (contentType == null) {
+            contentType = (String)getProperty(org.apache.cxf.message.Message.CONTENT_TYPE);
+        }
+        return contentType;
+    }
+    
+    public static JMSMessageHeadersType from(Message message) throws JMSException {
+        JMSMessageHeadersType messageHeaders = new JMSMessageHeadersType();
+        messageHeaders.read(message);
+        return messageHeaders;
+    }
+    
+    private void read(Message message) throws JMSException {
+        setJMSCorrelationID(message.getJMSCorrelationID());
+        setJMSDeliveryMode(Integer.valueOf(message.getJMSDeliveryMode()));
+        setJMSExpiration(Long.valueOf(message.getJMSExpiration()));
+        setJMSMessageID(message.getJMSMessageID());
+        setJMSPriority(Integer.valueOf(message.getJMSPriority()));
+        setJMSRedelivered(Boolean.valueOf(message.getJMSRedelivered()));
+        setJMSTimeStamp(Long.valueOf(message.getJMSTimestamp()));
+        setJMSType(message.getJMSType());
+        setSOAPJMSTargetService(message.getStringProperty(JMSSpecConstants.TARGETSERVICE_FIELD));
+        setSOAPJMSBindingVersion(message.getStringProperty(JMSSpecConstants.BINDINGVERSION_FIELD));
+        setSOAPJMSContentType(message.getStringProperty(JMSSpecConstants.CONTENTTYPE_FIELD));
+        setSOAPJMSContentEncoding(message.getStringProperty(JMSSpecConstants.CONTENTENCODING_FIELD));
+        setSOAPJMSSOAPAction(message.getStringProperty(JMSSpecConstants.SOAPACTION_FIELD));
+        if (message.propertyExists(JMSSpecConstants.ISFAULT_FIELD)) {
+            setSOAPJMSIsFault(message.getBooleanProperty(JMSSpecConstants.ISFAULT_FIELD));
+        }
+        setSOAPJMSRequestURI(message.getStringProperty(JMSSpecConstants.REQUESTURI_FIELD));
+
+        setJMSReplyTo(getDestName(message));
+        readProperties(message);
+    }
+
+    private String getDestName(Message message) throws JMSException {
+        Destination replyTo = message.getJMSReplyTo();
+        if (replyTo instanceof Queue) {
+            return ((Queue)replyTo).getQueueName();
+        } else if (replyTo instanceof Topic) {
+            return ((Topic)replyTo).getTopicName();
+        }
+        return null;
+    }
+
+    private void readProperties(Message message) throws JMSException {
+        Enumeration<String> enm = CastUtils.cast(message.getPropertyNames());
+        while (enm.hasMoreElements()) {
+            String name = enm.nextElement();
+            String val = message.getStringProperty(name);
+            putProperty(name, val);
+        }
+    }
+    
+    public void writeProp(Message jmsMessage, String name, Object value) throws JMSException {
+        if (value == null) {
+            jmsMessage.setStringProperty(name, null);
+            return;
+        }
+        Class<?> cls = value.getClass();
+        if (cls == String.class) {
+            jmsMessage.setStringProperty(name, (String)value);
+        } else if (cls == Integer.TYPE || cls == Integer.class) {
+            jmsMessage.setIntProperty(name, (Integer)value);
+        } else if (cls == Double.TYPE || cls == Double.class) {
+            jmsMessage.setDoubleProperty(name, (Double)value);
+        } else if (cls == Float.TYPE || cls == Float.class) {
+            jmsMessage.setFloatProperty(name, (Float)value);
+        } else if (cls == Long.TYPE || cls == Long.class) {
+            jmsMessage.setLongProperty(name, (Long)value);
+        } else if (cls == Boolean.TYPE || cls == Boolean.class) {
+            jmsMessage.setBooleanProperty(name, (Boolean)value);
+        } else if (cls == Short.TYPE || cls == Short.class) {
+            jmsMessage.setShortProperty(name, (Short)value);
+        } else if (cls == Byte.TYPE || cls == Byte.class) {
+            jmsMessage.setShortProperty(name, (Byte)value);
+        } else {
+            jmsMessage.setObjectProperty(name, value);
+        }
+    }
 
     /**
      * @param jmsMessage
@@ -312,18 +419,17 @@ public class JMSMessageHeadersType {
             jmsMessage.setBooleanProperty(JMSSpecConstants.ISFAULT_FIELD, isSOAPJMSIsFault());
         }
 
-        if (isSetProperty()) {
-            for (JMSPropertyType prop : getProperty()) {
-                prop.writeTo(jmsMessage);
-            }
+        for (String key : properties.keySet()) {
+            writeProp(jmsMessage, key, properties.get(key));
         }
     }
     
-    private static void setProp(Message jmsMessage, String name, String value) throws JMSException {
+    private void setProp(Message jmsMessage, String name, String value) throws JMSException {
         if (value != null) {
             jmsMessage.setStringProperty(name, value);
         }
     }
+    
+
 
 }
-//CHECKSTYLE:ON
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
index 04a8e6c..d599294 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
@@ -26,7 +26,6 @@ import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.StandardCharsets;
 import java.util.Collections;
-import java.util.Enumeration;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -34,13 +33,10 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.jms.BytesMessage;
-import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
-import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import javax.jms.Topic;
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
@@ -48,7 +44,6 @@ import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.HttpHeaderHelper;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.message.MessageUtils;
-import org.apache.cxf.transport.jms.spec.JMSSpecConstants;
 import org.apache.cxf.transport.jms.uri.JMSEndpoint;
 import org.apache.cxf.transport.jms.util.JMSMessageConverter;
 import org.apache.cxf.transport.jms.util.JMSUtil;
@@ -62,10 +57,12 @@ final class JMSMessageUtils {
     private JMSMessageUtils() {
 
     }
-    public static org.apache.cxf.message.Message asCXFMessage(Message message, String headerType)
+    public static org.apache.cxf.message.Message asCXFMessage(Message message, String jmsHeadersKey)
         throws UnsupportedEncodingException, JMSException {
         org.apache.cxf.message.Message inMessage = new MessageImpl();
-        populateIncomingContext(message, inMessage, headerType);
+        JMSMessageHeadersType messageHeaders = JMSMessageHeadersType.from(message);
+        inMessage.put(jmsHeadersKey, messageHeaders);
+        populateIncomingContext(messageHeaders, inMessage);
         retrieveAndSetPayload(inMessage, message);
         return inMessage;
     }
@@ -78,7 +75,7 @@ final class JMSMessageUtils {
      * @throws UnsupportedEncodingException
      * @throws JMSException
      */
-    public static void retrieveAndSetPayload(org.apache.cxf.message.Message inMessage, Message message)
+    private static void retrieveAndSetPayload(org.apache.cxf.message.Message inMessage, Message message)
         throws UnsupportedEncodingException, JMSException {
         String messageType = null;
         Object converted = new JMSMessageConverter().fromMessage(message);
@@ -93,133 +90,45 @@ final class JMSMessageUtils {
         }
         Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>)inMessage
             .get(org.apache.cxf.message.Message.PROTOCOL_HEADERS));
-        if (headers == null) {
-            headers = new TreeMap<String, List<String>>();
-            inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
-        }
-        headers.put(JMSSpecConstants.JMS_MESSAGE_TYPE, Collections.singletonList(messageType));
+        headers.put(JMSConstants.JMS_MESSAGE_TYPE, Collections.singletonList(messageType));
     }
 
-    private static void populateIncomingContext(javax.jms.Message message,
-                                               org.apache.cxf.message.Message inMessage, String messageType)
-        throws UnsupportedEncodingException, JMSException {
-        JMSMessageHeadersType messageProperties = null;
-        messageProperties = (JMSMessageHeadersType)inMessage.get(messageType);
-        if (messageProperties == null) {
-            messageProperties = new JMSMessageHeadersType();
-            inMessage.put(messageType, messageProperties);
+    private static void populateIncomingContext(JMSMessageHeadersType messageHeaders,
+                                               org.apache.cxf.message.Message inMessage) 
+                                                   throws UnsupportedEncodingException {
+        String contentType = messageHeaders.getContentType();
+        if (contentType != null) {
+            inMessage.put(org.apache.cxf.message.Message.CONTENT_TYPE, contentType);
+            inMessage.put(org.apache.cxf.message.Message.ENCODING, getEncoding(contentType));
         }
-        messageProperties.setJMSCorrelationID(message.getJMSCorrelationID());
-        messageProperties.setJMSDeliveryMode(Integer.valueOf(message.getJMSDeliveryMode()));
-        messageProperties.setJMSExpiration(Long.valueOf(message.getJMSExpiration()));
-        messageProperties.setJMSMessageID(message.getJMSMessageID());
-        messageProperties.setJMSPriority(Integer.valueOf(message.getJMSPriority()));
-        messageProperties.setJMSRedelivered(Boolean.valueOf(message.getJMSRedelivered()));
-        messageProperties.setJMSTimeStamp(Long.valueOf(message.getJMSTimestamp()));
-        messageProperties.setJMSType(message.getJMSType());
-
-        if (message.getJMSReplyTo() != null) {
-            Destination replyTo = message.getJMSReplyTo();
-            if (replyTo instanceof Queue) {
-                messageProperties.setJMSReplyTo(((Queue)replyTo).getQueueName());
-            } else if (replyTo instanceof Topic) {
-                messageProperties.setJMSReplyTo(((Topic)replyTo).getTopicName());
-            }
+        String responseCode = (String)messageHeaders.getProperty(org.apache.cxf.message.Message.RESPONSE_CODE);
+        if (responseCode != null) {
+            inMessage.put(org.apache.cxf.message.Message.RESPONSE_CODE, Integer.valueOf(responseCode));
         }
-
         Map<String, List<String>> protHeaders = new TreeMap<String, List<String>>();
-        List<JMSPropertyType> props = messageProperties.getProperty();
-        Enumeration<String> enm = CastUtils.cast(message.getPropertyNames());
-        while (enm.hasMoreElements()) {
-            String name = enm.nextElement();
-            String val = message.getStringProperty(name);
-            props.add(new JMSPropertyType(name, val));
-
+        for (String name : messageHeaders.getPropertyKeys()) {
+            String val = (String)messageHeaders.getProperty(name);
             protHeaders.put(name, Collections.singletonList(val));
-            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);
-                // set the message encoding
-                inMessage.put(org.apache.cxf.message.Message.ENCODING, getEncoding(val));
-            }
-            if (name.equals(org.apache.cxf.message.Message.RESPONSE_CODE)) {
-                inMessage.put(org.apache.cxf.message.Message.RESPONSE_CODE, Integer.valueOf(val));
-            }
-        }
-        inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, protHeaders);
-
-        populateIncomingMessageProperties(message, inMessage, messageProperties);
-    }
-
-    /**
-     * @param jmsMessage
-     * @param inMessage
-     * @param messagePropertiesType
-     * @throws UnsupportedEncodingException
-     * @throws JMSException
-     */
-    private static void populateIncomingMessageProperties(Message jmsMessage,
-                                                          org.apache.cxf.message.Message inMessage,
-                                                          JMSMessageHeadersType messageProperties)
-        throws UnsupportedEncodingException, JMSException {
-        if (jmsMessage.propertyExists(JMSSpecConstants.TARGETSERVICE_FIELD)) {
-            messageProperties.setSOAPJMSTargetService(jmsMessage
-                .getStringProperty(JMSSpecConstants.TARGETSERVICE_FIELD));
-        }
-        if (jmsMessage.propertyExists(JMSSpecConstants.BINDINGVERSION_FIELD)) {
-            messageProperties.setSOAPJMSBindingVersion(jmsMessage
-                .getStringProperty(JMSSpecConstants.BINDINGVERSION_FIELD));
-        }
-        if (jmsMessage.propertyExists(JMSSpecConstants.CONTENTTYPE_FIELD)) {
-            messageProperties.setSOAPJMSContentType(jmsMessage
-                .getStringProperty(JMSSpecConstants.CONTENTTYPE_FIELD));
-        }
-        if (jmsMessage.propertyExists(JMSSpecConstants.CONTENTENCODING_FIELD)) {
-            messageProperties.setSOAPJMSContentEncoding(jmsMessage
-                .getStringProperty(JMSSpecConstants.CONTENTENCODING_FIELD));
-        }
-        if (jmsMessage.propertyExists(JMSSpecConstants.SOAPACTION_FIELD)) {
-            messageProperties.setSOAPJMSSOAPAction(jmsMessage
-                .getStringProperty(JMSSpecConstants.SOAPACTION_FIELD));
-        }
-        if (jmsMessage.propertyExists(JMSSpecConstants.ISFAULT_FIELD)) {
-            messageProperties
-                .setSOAPJMSIsFault(jmsMessage.getBooleanProperty(JMSSpecConstants.ISFAULT_FIELD));
         }
-        if (jmsMessage.propertyExists(JMSSpecConstants.REQUESTURI_FIELD)) {
-            messageProperties.setSOAPJMSRequestURI(jmsMessage
-                .getStringProperty(JMSSpecConstants.REQUESTURI_FIELD));
-
-            Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>)inMessage
-                .get(org.apache.cxf.message.Message.PROTOCOL_HEADERS));
-            if (headers == null) {
-                headers = new TreeMap<String, List<String>>();
-                inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, headers);
-            }
+        String requestURI = messageHeaders.getSOAPJMSRequestURI();
+        if (requestURI != null) {
             try {
-                String requestURI = jmsMessage.getStringProperty(JMSSpecConstants.REQUESTURI_FIELD);
                 JMSEndpoint endpoint = new JMSEndpoint(requestURI);
                 if (endpoint.getTargetService() != null) {
-                    headers.put(JMSSpecConstants.TARGET_SERVICE_IN_REQUESTURI,
-                                Collections.singletonList("true"));
+                    protHeaders.put(JMSConstants.TARGET_SERVICE_IN_REQUESTURI,
+                                    Collections.singletonList("true"));
                 }
                 if (requestURI != null) {
                     inMessage.put(org.apache.cxf.message.Message.REQUEST_URI, requestURI);
                 }
             } catch (Exception e) {
-                headers.put(JMSSpecConstants.MALFORMED_REQUESTURI, Collections.singletonList("true"));
+                protHeaders.put(JMSConstants.MALFORMED_REQUESTURI, Collections.singletonList("true"));
             }
         }
-
-        if (messageProperties.isSetSOAPJMSContentType()) {
-            String contentType = messageProperties.getSOAPJMSContentType();
-            inMessage.put(org.apache.cxf.message.Message.CONTENT_TYPE, contentType);
-            // set the message encoding
-            inMessage.put(org.apache.cxf.message.Message.ENCODING, getEncoding(contentType));
-        }
-
+        inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS, protHeaders);
     }
 
+
     static String getEncoding(String ct) throws UnsupportedEncodingException {
         String contentType = ct.toLowerCase();
         String enc = null;
@@ -292,115 +201,82 @@ final class JMSMessageUtils {
         throws JMSException {
 
         Message jmsMessage = JMSUtil.createAndSetPayload(payload, session, messageType);
-        JMSMessageHeadersType messageProperties = getOrCreateHeader(outMessage, headerType);
-        JMSMessageUtils.prepareJMSMessageHeaderProperties(messageProperties, outMessage, jmsConfig);
-        JMSMessageUtils.prepareJMSMessageProperties(messageProperties, outMessage,
-                                                    jmsConfig.getTargetService(), jmsConfig.getRequestURI());
-        messageProperties.writeTo(jmsMessage);
-        jmsMessage.setJMSCorrelationID(correlationId);
-        return jmsMessage;
-    }
-
-    private static JMSMessageHeadersType getOrCreateHeader(org.apache.cxf.message.Message message,
-                                                           String headerName) {
-        JMSMessageHeadersType messageProperties = (JMSMessageHeadersType)message
-            .get(headerName);
-        if (messageProperties == null) {
-            messageProperties = new JMSMessageHeadersType();
-            message.put(headerName, messageProperties);
+        JMSMessageHeadersType messageHeaders = getOrCreateHeader(outMessage, headerType);
+        if (!messageHeaders.isSetJMSDeliveryMode()) {
+            messageHeaders.setJMSDeliveryMode(jmsConfig.getDeliveryMode());
         }
-        return messageProperties;
-    }
-
-    /**
-     * @param messageProperteis
-     * @param outMessage
-     * @param jmsConfig
-     */
-    private static void prepareJMSMessageHeaderProperties(
-                                                          JMSMessageHeadersType messageProperteis,
-                                                          org.apache.cxf.message.Message outMessage,
-                                                          JMSConfiguration jmsConfig) {
-        if (!messageProperteis.isSetJMSDeliveryMode()) {
-            messageProperteis.setJMSDeliveryMode(jmsConfig.getDeliveryMode());
-        }
-        if (!messageProperteis.isSetTimeToLive()) {
-            messageProperteis.setTimeToLive(jmsConfig.getTimeToLive());
+        if (!messageHeaders.isSetTimeToLive()) {
+            messageHeaders.setTimeToLive(jmsConfig.getTimeToLive());
         }
-        if (!messageProperteis.isSetJMSPriority()) {
-            messageProperteis.setJMSPriority(jmsConfig.getPriority());
+        if (!messageHeaders.isSetJMSPriority()) {
+            messageHeaders.setJMSPriority(jmsConfig.getPriority());
         }
-    }
-
-    /**
-     * @param messageProperties
-     * @param outMessage
-     * @param jmsConfig
-     * @param targetService TODO
-     * @param requestURI TODO
-     */
-    private static void prepareJMSMessageProperties(JMSMessageHeadersType messageProperties,
-                                                    org.apache.cxf.message.Message outMessage,
-                                                    String targetService,
-                                                    String requestURI) {
-
         // Retrieve or create protocol headers
         Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>)outMessage
             .get(org.apache.cxf.message.Message.PROTOCOL_HEADERS));
-
+        
         boolean isSoapMessage =
             !MessageUtils.isTrue(outMessage.getExchange().get(org.apache.cxf.message.Message.REST_MESSAGE));
-
+        
         if (isSoapMessage) {
-            if (!messageProperties.isSetSOAPJMSTargetService()) {
-                messageProperties.setSOAPJMSTargetService(targetService);
+            if (!messageHeaders.isSetSOAPJMSTargetService()) {
+                messageHeaders.setSOAPJMSTargetService(jmsConfig.getTargetService());
             }
-            if (!messageProperties.isSetSOAPJMSBindingVersion()) {
-                messageProperties.setSOAPJMSBindingVersion("1.0");
+            if (!messageHeaders.isSetSOAPJMSBindingVersion()) {
+                messageHeaders.setSOAPJMSBindingVersion("1.0");
             }
-            messageProperties.setSOAPJMSContentType(getContentType(outMessage));
-            if (getContentEncoding(outMessage) != null) {
-                messageProperties.setSOAPJMSContentEncoding(getContentEncoding(outMessage));
+            messageHeaders.setSOAPJMSContentType(JMSMessageUtils.getContentType(outMessage));
+            if (JMSMessageUtils.getContentEncoding(outMessage) != null) {
+                messageHeaders.setSOAPJMSContentEncoding(JMSMessageUtils.getContentEncoding(outMessage));
             }
-            String soapAction = getSoapAction(messageProperties, outMessage, headers);
+            String soapAction = JMSMessageUtils.getSoapAction(messageHeaders, outMessage, headers);
             if (soapAction != null) {
-                messageProperties.setSOAPJMSSOAPAction(soapAction);
+                messageHeaders.setSOAPJMSSOAPAction(soapAction);
             }
-            if (!messageProperties.isSetSOAPJMSIsFault()) {
+            if (!messageHeaders.isSetSOAPJMSIsFault()) {
                 boolean isFault = outMessage.getContent(Exception.class) != null;
-                messageProperties.setSOAPJMSIsFault(isFault);
+                messageHeaders.setSOAPJMSIsFault(isFault);
             }
-            if (!messageProperties.isSetSOAPJMSRequestURI()) {
-                messageProperties.setSOAPJMSRequestURI(requestURI);
+            if (!messageHeaders.isSetSOAPJMSRequestURI()) {
+                messageHeaders.setSOAPJMSRequestURI(jmsConfig.getRequestURI());
             }
         } else {
             if (MessageUtils.isRequestor(outMessage)) {
-                addJMSPropertiesFromMessage(messageProperties,
+                addJMSPropertiesFromMessage(messageHeaders,
                                             outMessage,
                                             org.apache.cxf.message.Message.HTTP_REQUEST_METHOD,
                                             org.apache.cxf.message.Message.REQUEST_URI,
                                             org.apache.cxf.message.Message.ACCEPT_CONTENT_TYPE);
             } else {
-                addJMSPropertyFromMessage(messageProperties,
+                addJMSPropertyFromMessage(messageHeaders,
                                           outMessage,
                                           org.apache.cxf.message.Message.RESPONSE_CODE);
             }
-            addJMSPropertyFromMessage(messageProperties,
+            addJMSPropertyFromMessage(messageHeaders,
                                       outMessage,
                                       org.apache.cxf.message.Message.CONTENT_TYPE);
         }
         if (headers != null) {
             for (Map.Entry<String, List<String>> ent : headers.entrySet()) {
-                JMSPropertyType prop = asJmsProperty(ent.getKey(), ent.getValue());
-                messageProperties.getProperty().add(prop);
+                messageHeaders.putProperty(ent.getKey(), JMSMessageUtils.join(ent.getValue(), ','));
             }
         }
+        messageHeaders.writeTo(jmsMessage);
+        jmsMessage.setJMSCorrelationID(correlationId);
+        return jmsMessage;
     }
 
-    private static JMSPropertyType asJmsProperty(String key, List<String> value) {
-        return new JMSPropertyType(key, join(value, ','));
+    private static JMSMessageHeadersType getOrCreateHeader(org.apache.cxf.message.Message message,
+                                                           String headerName) {
+        JMSMessageHeadersType messageProperties = (JMSMessageHeadersType)message
+            .get(headerName);
+        if (messageProperties == null) {
+            messageProperties = new JMSMessageHeadersType();
+            message.put(headerName, messageProperties);
+        }
+        return messageProperties;
     }
-    
+
     private static String join(List<String> valueList, char seperator) {
         StringBuilder b = new StringBuilder();
         for (String s : valueList) {
@@ -448,8 +324,7 @@ final class JMSMessageUtils {
                                                   String key) {
         Object value = message.get(key);
         if (value != null) {
-            JMSPropertyType prop = new JMSPropertyType(key, value.toString());
-            messageProperties.getProperty().add(prop);
+            messageProperties.putProperty(key, value.toString());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSPropertyType.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSPropertyType.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSPropertyType.java
index c509a05..a66c2d8 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSPropertyType.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSPropertyType.java
@@ -18,22 +18,14 @@
  */
 package org.apache.cxf.transport.jms;
 
-import javax.jms.JMSException;
-import javax.jms.Message;
-
+@Deprecated
 public class JMSPropertyType {
     private String name;
     private Object value;
     
-    @Deprecated
     public JMSPropertyType() {
     }
     
-    public JMSPropertyType(String name, Object value) {
-        this.name = name;
-        this.value = value;
-    }
-
     public String getName() {
         return name;
     }
@@ -42,41 +34,13 @@ public class JMSPropertyType {
         return value;
     }
     
-    @Deprecated
     public void setName(String name) {
         this.name = name;
     }
 
-    @Deprecated
     public void setValue(Object value) {
         this.value = value;
     }
 
-    public void writeTo(Message jmsMessage) throws JMSException {
-        if (value == null) {
-            jmsMessage.setStringProperty(name, null);
-            return;
-        }
-        Class<?> cls = value.getClass();
-        if (cls == String.class) {
-            jmsMessage.setStringProperty(name, (String)value);
-        } else if (cls == Integer.TYPE || cls == Integer.class) {
-            jmsMessage.setIntProperty(name, (Integer)value);
-        } else if (cls == Double.TYPE || cls == Double.class) {
-            jmsMessage.setDoubleProperty(name, (Double)value);
-        } else if (cls == Float.TYPE || cls == Float.class) {
-            jmsMessage.setFloatProperty(name, (Float)value);
-        } else if (cls == Long.TYPE || cls == Long.class) {
-            jmsMessage.setLongProperty(name, (Long)value);
-        } else if (cls == Boolean.TYPE || cls == Boolean.class) {
-            jmsMessage.setBooleanProperty(name, (Boolean)value);
-        } else if (cls == Short.TYPE || cls == Short.class) {
-            jmsMessage.setShortProperty(name, (Short)value);
-        } else if (cls == Byte.TYPE || cls == Byte.class) {
-            jmsMessage.setShortProperty(name, (Byte)value);
-        } else {
-            jmsMessage.setObjectProperty(name, value);
-        }
-    }
 }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java
index 5d3ebff..0218ed3 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/spec/JMSSpecConstants.java
@@ -27,6 +27,7 @@ public final class JMSSpecConstants {
 
     public static final String SOAP_JMS_SPECIFICATION_TRANSPORTID
         = "http://www.w3.org/2010/soapjms/";
+    @Deprecated
     public static final String SOAP_JMS_NAMESPACE = SOAP_JMS_SPECIFICATION_TRANSPORTID;
 
     public static final String SOAP_JMS_PREFIX = "SOAPJMS_";
@@ -68,10 +69,6 @@ public final class JMSSpecConstants {
     public static final String CONTENTENCODING_FIELD = SOAP_JMS_PREFIX + CONTENTENCODING_PARAMETER_NAME;
     public static final String ISFAULT_FIELD = SOAP_JMS_PREFIX + ISFAULT_PARAMETER_NAME;
 
-    public static final String JMS_MESSAGE_TYPE = "JMSMessageType";
-    public static final String TARGET_SERVICE_IN_REQUESTURI = "target.service.inrequesturi";
-    public static final String MALFORMED_REQUESTURI = "malformed.requesturi";
-
     private JMSSpecConstants() {
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
index 1b0b305..088a13c 100644
--- a/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
+++ b/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
@@ -261,7 +261,7 @@ public class JMSDestinationTest extends AbstractJMSTester {
 
         JMSMessageHeadersType headers = (JMSMessageHeadersType)outMessage
             .get(JMSConstants.JMS_CLIENT_REQUEST_HEADERS);
-        headers.getProperty().add(new JMSPropertyType(customPropertyName, customPropertyName));
+        headers.putProperty(customPropertyName, customPropertyName);
 
         final JMSDestination destination = setupJMSDestination(ei);
 
@@ -300,7 +300,6 @@ public class JMSDestinationTest extends AbstractJMSTester {
         JMSMessageHeadersType inHeader = (JMSMessageHeadersType)inMessage
             .get(JMSConstants.JMS_CLIENT_RESPONSE_HEADERS);
         assertNotNull("The inHeader should not be null", inHeader);
-        assertNotNull("The property should not be null " + inHeader.getProperty());
         // TODO we need to check the SOAP JMS transport properties here
 
         // wait for a while for the jms session recycling

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
index 44b56d8..a83526a 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
@@ -60,7 +60,6 @@ import org.apache.cxf.transport.jms.JMSConfigFeature;
 import org.apache.cxf.transport.jms.JMSConfiguration;
 import org.apache.cxf.transport.jms.JMSConstants;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
-import org.apache.cxf.transport.jms.JMSPropertyType;
 import org.apache.cxf.transport.jms.util.TestReceiver;
 import org.apache.hello_world_doc_lit.Greeter;
 import org.apache.hello_world_doc_lit.PingMeFault;
@@ -558,8 +557,8 @@ public class JMSClientServerTest extends AbstractBusClientServerTestBase {
         JMSMessageHeadersType requestHeader = new JMSMessageHeadersType();
         requestHeader.setJMSCorrelationID("JMS_SAMPLE_CORRELATION_ID");
         requestHeader.setJMSExpiration(3600000L);
-        requestHeader.getProperty().add(new JMSPropertyType(testReturnPropertyName, "mustReturn"));
-        requestHeader.getProperty().add(new JMSPropertyType(testIgnoredPropertyName, "mustNotReturn"));
+        requestHeader.putProperty(testReturnPropertyName, "mustReturn");
+        requestHeader.putProperty(testIgnoredPropertyName, "mustNotReturn");
         requestContext.put(JMSConstants.JMS_CLIENT_REQUEST_HEADERS, requestHeader);
 
         String greeting = greeter.greetMe("Milestone-");
@@ -577,14 +576,10 @@ public class JMSClientServerTest extends AbstractBusClientServerTestBase {
         assertTrue("CORRELATION ID should match :",
                    "JMS_SAMPLE_CORRELATION_ID".equals(responseHdr.getJMSCorrelationID()));
         assertTrue("response Headers must conain the app property set in request context.",
-                   responseHdr.getProperty() != null);
+                   responseHdr.getPropertyKeys().size() > 0);
 
-        boolean found = false;
-        for (JMSPropertyType p : responseHdr.getProperty()) {
-            if (testReturnPropertyName.equals(p.getName())) {
-                found = true;
-            }
-        }
+        
+        boolean found = responseHdr.getPropertyKeys().contains(testReturnPropertyName);
         assertTrue("response Headers must match the app property set in request context.", found);
         ((Closeable)greeter).close();
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
index 79499e1..953c789 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/TwoWayJMSImplBase.java
@@ -35,7 +35,6 @@ import org.apache.cxf.hello_world_jms.types.NoSuchCodeLit;
 import org.apache.cxf.hello_world_jms.types.TestRpcLitFaultResponse;
 import org.apache.cxf.transport.jms.JMSConstants;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
-import org.apache.cxf.transport.jms.JMSPropertyType;
 
 public class TwoWayJMSImplBase implements HelloWorldPortType {
 
@@ -54,7 +53,7 @@ public class TwoWayJMSImplBase implements HelloWorldPortType {
         MessageContext mc = wsContext.getMessageContext();
         JMSMessageHeadersType responseHeaders =
             (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
-        responseHeaders.getProperty().add(new JMSPropertyType("Test_Prop", "some return value "  + me));
+        responseHeaders.putProperty("Test_Prop", "some return value "  + me);
         return "Hello " + me;
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/0a4d2676/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
index 511ea8b..d143a4e 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/TwoWayJMSImplBase.java
@@ -35,7 +35,6 @@ import org.apache.cxf.hello_world_jms.types.NoSuchCodeLit;
 import org.apache.cxf.hello_world_jms.types.TestRpcLitFaultResponse;
 import org.apache.cxf.transport.jms.JMSConstants;
 import org.apache.cxf.transport.jms.JMSMessageHeadersType;
-import org.apache.cxf.transport.jms.JMSPropertyType;
 
 public class TwoWayJMSImplBase implements HelloWorldPortType {
 
@@ -52,16 +51,16 @@ public class TwoWayJMSImplBase implements HelloWorldPortType {
             me = me.substring("PauseForTwoSecs".length()).trim();
         }
 
-        addToReply(new JMSPropertyType("Test_Prop", "some return value "  + me));
+        addToReply("Test_Prop", "some return value "  + me);
 
         return "Hello " + me;
     }
 
-    private void addToReply(JMSPropertyType prop) {
+    private void addToReply(String key, String value) {
         MessageContext mc = wsContext.getMessageContext();
         JMSMessageHeadersType responseHeaders =
             (JMSMessageHeadersType) mc.get(JMSConstants.JMS_SERVER_RESPONSE_HEADERS);
-        responseHeaders.getProperty().add(prop);
+        responseHeaders.putProperty(key, value);
     }
 
     public String sayHi() {


Mime
View raw message