activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1386583 - in /activemq/trunk: ./ activemq-karaf/src/main/resources/ activemq-optional/ activemq-optional/src/main/java/org/apache/activemq/util/oxm/ assembly/ assembly/src/main/descriptors/
Date Mon, 17 Sep 2012 12:38:51 GMT
Author: davsclaus
Date: Mon Sep 17 12:38:51 2012
New Revision: 1386583

URL: http://svn.apache.org/viewvc?rev=1386583&view=rev
Log:
AMQ-4060: Upgraded Spring OXM to Spring 3 version.

Modified:
    activemq/trunk/activemq-karaf/src/main/resources/features.xml
    activemq/trunk/activemq-optional/pom.xml
    activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/oxm/OXMMessageTransformer.java
    activemq/trunk/assembly/pom.xml
    activemq/trunk/assembly/src/main/descriptors/common-bin.xml
    activemq/trunk/pom.xml

Modified: activemq/trunk/activemq-karaf/src/main/resources/features.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/resources/features.xml?rev=1386583&r1=1386582&r2=1386583&view=diff
==============================================================================
--- activemq/trunk/activemq-karaf/src/main/resources/features.xml (original)
+++ activemq/trunk/activemq-karaf/src/main/resources/features.xml Mon Sep 17 12:38:51 2012
@@ -64,6 +64,7 @@
 
     <feature name="activemq-optional" version="${activemq-version}" resolver="(obr)">
         <feature version="${activemq-version}">activemq-blueprint</feature>
+        <feature version="${activemq-version}">activemq-spring</feature>
         <feature version="[7.5,8.0)">jetty</feature>
         <bundle>mvn:org.apache.activemq/activemq-optional/${activemq-version}</bundle>
         <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.josql/${josql-version}</bundle>
@@ -73,6 +74,7 @@
         <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlbeans/${xmlbeans-bundle-version}</bundle>
         <bundle>mvn:org.apache.httpcomponents/httpcore-osgi/${httpclient-version}</bundle>
         <bundle>mvn:org.apache.httpcomponents/httpclient-osgi/${httpclient-version}</bundle>
+        <bundle>mvn:org.springframework/spring-oxm/${spring-version}</bundle>
     </feature>
 
     <feature name="activemq-camel" version="${activemq-version}" resolver="(obr)">

Modified: activemq/trunk/activemq-optional/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/pom.xml?rev=1386583&r1=1386582&r2=1386583&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/pom.xml (original)
+++ activemq/trunk/activemq-optional/pom.xml Mon Sep 17 12:38:51 2012
@@ -162,9 +162,9 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-        <groupId>org.springframework.ws</groupId>
-        <artifactId>spring-oxm-tiger</artifactId>
-        <optional>true</optional>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-oxm</artifactId>
+      <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>org.apache.xbean</groupId>

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/oxm/OXMMessageTransformer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/oxm/OXMMessageTransformer.java?rev=1386583&r1=1386582&r2=1386583&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/oxm/OXMMessageTransformer.java
(original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/util/oxm/OXMMessageTransformer.java
Mon Sep 17 12:38:51 2012
@@ -17,17 +17,22 @@
 
 package org.apache.activemq.util.oxm;
 
+import java.io.StringReader;
+import java.io.StringWriter;
 import javax.jms.JMSException;
 import javax.jms.ObjectMessage;
 import javax.jms.Session;
 import javax.jms.TextMessage;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.springframework.oxm.support.AbstractMarshaller;
 
-import org.springframework.oxm.AbstractMarshaller;
-import org.springframework.xml.transform.StringResult;
-import org.springframework.xml.transform.StringSource;
 
 /**
- * Transforms object messages to text messages and vice versa using {@link Spring OXM}
+ * Transforms object messages to text messages and vice versa using Spring OXM.
  *
  */
 public class OXMMessageTransformer extends AbstractXMLMessageTransformer {
@@ -51,10 +56,12 @@ public class OXMMessageTransformer exten
      */
 	protected String marshall(Session session, ObjectMessage objectMessage)
 			throws JMSException {
-		StringResult result = new StringResult();
 		try {
-			marshaller.marshal(objectMessage.getObject(), result);
-			return result.toString();
+            StringWriter writer = new StringWriter();
+            Result result = new StreamResult(writer);
+            marshaller.marshal(objectMessage.getObject(), result);
+            writer.flush();
+			return writer.toString();
 		} catch (Exception e) {
 			throw new JMSException(e.getMessage());
 		}
@@ -67,7 +74,9 @@ public class OXMMessageTransformer exten
 	protected Object unmarshall(Session session, TextMessage textMessage)
 			throws JMSException {
 		try {
-			return marshaller.unmarshal(new StringSource(textMessage.getText()));
+            String text = textMessage.getText();
+            Source source = new StreamSource(new StringReader(text));
+			return marshaller.unmarshal(source);
 		} catch (Exception e) {
 			throw new JMSException(e.getMessage());
 		}

Modified: activemq/trunk/assembly/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/assembly/pom.xml?rev=1386583&r1=1386582&r2=1386583&view=diff
==============================================================================
--- activemq/trunk/assembly/pom.xml (original)
+++ activemq/trunk/assembly/pom.xml Mon Sep 17 12:38:51 2012
@@ -230,8 +230,8 @@
       <optional>false</optional>
     </dependency>
     <dependency>
-        <groupId>org.springframework.ws</groupId>
-        <artifactId>spring-oxm-tiger</artifactId>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-oxm</artifactId>
     </dependency>
     <dependency>
       <groupId>org.codehaus.jettison</groupId>

Modified: activemq/trunk/assembly/src/main/descriptors/common-bin.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/assembly/src/main/descriptors/common-bin.xml?rev=1386583&r1=1386582&r2=1386583&view=diff
==============================================================================
--- activemq/trunk/assembly/src/main/descriptors/common-bin.xml (original)
+++ activemq/trunk/assembly/src/main/descriptors/common-bin.xml Mon Sep 17 12:38:51 2012
@@ -152,18 +152,18 @@
         <include>org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec</include>
         <include>org.apache.xbean:xbean-spring</include>
         <include>org.springframework:spring-aop</include>
-        <include>org.springframework:spring-core</include>
+        <include>org.springframework:spring-asm</include>
         <include>org.springframework:spring-beans</include>
         <include>org.springframework:spring-context</include>
-        <include>org.springframework:spring-tx</include>
-        <include>org.springframework:spring-jms</include>
-        <include>org.springframework:spring-asm</include>
+        <include>org.springframework:spring-core</include>
         <include>org.springframework:spring-expression</include>
+        <include>org.springframework:spring-jms</include>
+        <include>org.springframework:spring-oxm</include>
+        <include>org.springframework:spring-tx</include>
         <include>com.thoughtworks.xstream:xstream</include>
         <include>xpp3:xpp3</include>
         <include>org.codehaus.woodstox:woodstox-core-asl</include>
         <include>org.codehaus.woodstox:stax2-api</include>
-        <include>org.springframework.ws:spring-oxm-tiger</include>
         <include>org.codehaus.jettison:jettison</include>
         <include>org.apache.velocity:velocity</include>
         <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.josql</include>

Modified: activemq/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/pom.xml?rev=1386583&r1=1386582&r2=1386583&view=diff
==============================================================================
--- activemq/trunk/pom.xml (original)
+++ activemq/trunk/pom.xml Mon Sep 17 12:38:51 2012
@@ -641,9 +641,9 @@
         <version>${spring-version}</version>
       </dependency>
       <dependency>
-        <groupId>org.springframework.ws</groupId>
-        <artifactId>spring-oxm-tiger</artifactId>
-        <version>${spring-oxm-version}</version>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-oxm</artifactId>
+        <version>${spring-version}</version>
       </dependency>
       <dependency>
           <groupId>org.springframework.osgi</groupId>



Mime
View raw message