activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-3388
Date Wed, 13 Nov 2013 15:38:00 GMT
Updated Branches:
  refs/heads/trunk 6ed8f43d8 -> 5e5458ec3


https://issues.apache.org/jira/browse/AMQ-3388

ignore unknown fields in openwire commands to allow interop between
openwire versions.  

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/5e5458ec
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/5e5458ec
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/5e5458ec

Branch: refs/heads/trunk
Commit: 5e5458ec38f7a204bb40174e13262c7b892de89b
Parents: 6ed8f43
Author: Timothy Bish <tabish121@gmai.com>
Authored: Wed Nov 13 10:36:02 2013 -0500
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Wed Nov 13 10:36:53 2013 -0500

----------------------------------------------------------------------
 .../transport/xstream/XStreamWireFormat.java       | 17 ++++++++++++-----
 .../transport/stomp/JmsFrameTranslator.java        |  3 ++-
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/5e5458ec/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
b/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
index 7ac426a..de437c9 100755
--- a/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
@@ -19,13 +19,13 @@ package org.apache.activemq.transport.xstream;
 import java.io.IOException;
 import java.io.Reader;
 
-import com.thoughtworks.xstream.XStream;
-import org.apache.activemq.command.Command;
 import org.apache.activemq.command.MarshallAware;
 import org.apache.activemq.command.MessageDispatch;
 import org.apache.activemq.transport.util.TextWireFormat;
 import org.apache.activemq.wireformat.WireFormat;
 
+import com.thoughtworks.xstream.XStream;
+
 /**
  * A {@link WireFormat} implementation which uses the <a
  * href="http://xstream.codehaus.org/>XStream</a> library to marshall commands
@@ -37,10 +37,12 @@ public class XStreamWireFormat extends TextWireFormat {
     private XStream xStream;
     private int version;
 
+    @Override
     public int getVersion() {
         return version;
     }
 
+    @Override
     public void setVersion(int version) {
         this.version = version;
     }
@@ -49,14 +51,17 @@ public class XStreamWireFormat extends TextWireFormat {
         return new XStreamWireFormat();
     }
 
+    @Override
     public Object unmarshalText(String text) {
-        return (Command)getXStream().fromXML(text);
+        return getXStream().fromXML(text);
     }
 
+    @Override
     public Object unmarshalText(Reader reader) {
-        return (Command)getXStream().fromXML(reader);
+        return getXStream().fromXML(reader);
     }
 
+    @Override
     public String marshalText(Object command) throws IOException {
         if (command instanceof MarshallAware) {
             ((MarshallAware)command).beforeMarshall(this);
@@ -105,7 +110,9 @@ public class XStreamWireFormat extends TextWireFormat {
     // Implementation methods
     // -------------------------------------------------------------------------
     protected XStream createXStream() {
-        return new XStream();
+        XStream xstream = new XStream();
+        xstream.ignoreUnknownElements();
+        return xstream;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/5e5458ec/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java
----------------------------------------------------------------------
diff --git a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java
b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java
index 44cd420..6ae68fc 100644
--- a/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java
+++ b/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java
@@ -26,7 +26,6 @@ import java.util.Map;
 
 import javax.jms.JMSException;
 
-import com.thoughtworks.xstream.io.json.JsonHierarchicalStreamDriver;
 import org.apache.activemq.advisory.AdvisorySupport;
 import org.apache.activemq.broker.BrokerContext;
 import org.apache.activemq.broker.BrokerContextAware;
@@ -42,6 +41,7 @@ import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
 import com.thoughtworks.xstream.io.HierarchicalStreamReader;
 import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
 import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
+import com.thoughtworks.xstream.io.json.JsonHierarchicalStreamDriver;
 import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
 import com.thoughtworks.xstream.io.xml.XppReader;
 import com.thoughtworks.xstream.io.xml.xppdom.XppFactory;
@@ -253,6 +253,7 @@ public class JmsFrameTranslator extends LegacyFrameTranslator implements
 
         if (xstream == null) {
             xstream = new XStream();
+            xstream.ignoreUnknownElements();
         }
 
         // For any object whose elements contains an UTF8Buffer instance instead of a String


Mime
View raw message