From 8acbf4ceb5d0ceea26d468dd09ba710c8e0134e5 Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Tue, 23 Aug 2011 23:10:41 +0000 Subject: [PATCH] Fix for AMQ-3468. Updated to XStream v1.4.1 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1160923 13f79535-47bb-0310-9956-ffa450edef68 --- .../transport/stomp/JmsFrameTranslator.java | 2 +- .../util/JettisonMappedXmlDriver.java | 119 ------------------ pom.xml | 2 +- 3 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 activemq-core/src/main/java/org/apache/activemq/util/JettisonMappedXmlDriver.java diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java index cc28cf528d..3366ca386d 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/JmsFrameTranslator.java @@ -32,12 +32,12 @@ import org.apache.activemq.command.ActiveMQMapMessage; import org.apache.activemq.command.ActiveMQMessage; import org.apache.activemq.command.ActiveMQObjectMessage; import org.apache.activemq.command.DataStructure; -import org.apache.activemq.util.JettisonMappedXmlDriver; import org.codehaus.jettison.mapped.Configuration; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.HierarchicalStreamReader; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; +import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver; import com.thoughtworks.xstream.io.xml.PrettyPrintWriter; import com.thoughtworks.xstream.io.xml.XppReader; diff --git a/activemq-core/src/main/java/org/apache/activemq/util/JettisonMappedXmlDriver.java b/activemq-core/src/main/java/org/apache/activemq/util/JettisonMappedXmlDriver.java deleted file mode 100644 index 8486b4b0fa..0000000000 --- a/activemq-core/src/main/java/org/apache/activemq/util/JettisonMappedXmlDriver.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Copyright (c) 2007, 2008 XStream Committers. - * All rights reserved. - * - * The software in this package is published under the terms of the BSD - * style license a copy of which has been included with this distribution in - * the LICENSE.txt file. - * - * Created on 30. March 2007 by Joerg Schaible - */ -package org.apache.activemq.util; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Reader; -import java.io.Writer; - -import javax.xml.stream.XMLStreamException; - -import org.codehaus.jettison.mapped.Configuration; -import org.codehaus.jettison.mapped.MappedNamespaceConvention; -import org.codehaus.jettison.mapped.MappedXMLInputFactory; -import org.codehaus.jettison.mapped.MappedXMLOutputFactory; - -import com.thoughtworks.xstream.io.HierarchicalStreamDriver; -import com.thoughtworks.xstream.io.HierarchicalStreamReader; -import com.thoughtworks.xstream.io.HierarchicalStreamWriter; -import com.thoughtworks.xstream.io.StreamException; -import com.thoughtworks.xstream.io.json.JettisonStaxWriter; -import com.thoughtworks.xstream.io.xml.QNameMap; -import com.thoughtworks.xstream.io.xml.StaxReader; -import com.thoughtworks.xstream.io.xml.StaxWriter; - - -/** - * - * Temporary used until XStream 1.3.2 is released - * - * Simple XStream driver wrapping Jettison's Mapped reader and writer. Serializes object from - * and to JSON. - * - * @author Dejan Bosanac - */ -public class JettisonMappedXmlDriver implements HierarchicalStreamDriver { - - private final MappedXMLOutputFactory mof; - private final MappedXMLInputFactory mif; - private final MappedNamespaceConvention convention; - private boolean useSerializeAsArray = true; - - public JettisonMappedXmlDriver() { - this(new Configuration(), true); - } - - public JettisonMappedXmlDriver(final Configuration config, final boolean useSerializeAsArray) { - mof = new MappedXMLOutputFactory(config); - mif = new MappedXMLInputFactory(config); - convention = new MappedNamespaceConvention(config); - this.useSerializeAsArray = useSerializeAsArray; - } - - public HierarchicalStreamReader createReader(final Reader reader) { - try { - return new StaxReader(new QNameMap(), mif.createXMLStreamReader(reader)); - } catch (final XMLStreamException e) { - throw new StreamException(e); - } - } - - public HierarchicalStreamReader createReader(final InputStream input) { - try { - return new StaxReader(new QNameMap(), mif.createXMLStreamReader(input)); - } catch (final XMLStreamException e) { - throw new StreamException(e); - } - } - - public HierarchicalStreamWriter createWriter(final Writer writer) { - try { - if (useSerializeAsArray) { - return new JettisonStaxWriter(new QNameMap(), mof.createXMLStreamWriter(writer), convention); - } else { - return new StaxWriter(new QNameMap(), mof.createXMLStreamWriter(writer)); - } - } catch (final XMLStreamException e) { - throw new StreamException(e); - } - } - - public HierarchicalStreamWriter createWriter(final OutputStream output) { - try { - if (useSerializeAsArray) { - return new JettisonStaxWriter(new QNameMap(), mof.createXMLStreamWriter(output), convention); - } else { - return new StaxWriter(new QNameMap(), mof.createXMLStreamWriter(output)); - } - } catch (final XMLStreamException e) { - throw new StreamException(e); - } - } - -} diff --git a/pom.xml b/pom.xml index 4063b5a905..114f493be0 100755 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 2.6.0 2.0.0-beta1 1.1.4c - 1.3.1 + 1.4.1 3.7 1.6.2 2.1.0