camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1325005 - /camel/branches/camel-2.8.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
Date Wed, 11 Apr 2012 20:56:48 GMT
Author: cmueller
Date: Wed Apr 11 20:56:48 2012
New Revision: 1325005

URL: http://svn.apache.org/viewvc?rev=1325005&view=rev
Log:
CAMEL-3776: Add pooling support for JAXB data format

Modified:
    camel/branches/camel-2.8.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java

Modified: camel/branches/camel-2.8.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java?rev=1325005&r1=1325004&r2=1325005&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
(original)
+++ camel/branches/camel-2.8.x/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
Wed Apr 11 20:56:48 2012
@@ -132,7 +132,7 @@ public class FallbackTypeConverter imple
             throw new IllegalArgumentException("Cannot convert from null value to JAXBSource");
         }
 
-        Unmarshaller unmarshaller = getOrCreateUnmarshaller(type);
+        Unmarshaller unmarshaller = getUnmarshaller(type);
 
         if (parentTypeConverter != null) {
             if (!needFiltering(exchange)) {
@@ -189,7 +189,7 @@ public class FallbackTypeConverter imple
                 marshaller.setProperty(Marshaller.JAXB_ENCODING, exchange.getProperty(Exchange.CHARSET_NAME,
String.class));
             }
             if (needFiltering(exchange)) {
-                XMLStreamWriter writer = exchange.getContext().getTypeConverter().convertTo(XMLStreamWriter.class,
buffer);
+                XMLStreamWriter writer = parentTypeConverter.convertTo(XMLStreamWriter.class,
buffer);
                 FilteringXmlStreamWriter filteringWriter = new FilteringXmlStreamWriter(writer);
                 marshaller.marshal(value, filteringWriter);
             } else {
@@ -247,7 +247,7 @@ public class FallbackTypeConverter imple
         return context;
     }
 
-    protected synchronized <T> Unmarshaller getOrCreateUnmarshaller(Class<T>
type) throws JAXBException {
+    protected synchronized <T> Unmarshaller getUnmarshaller(Class<T> type) throws
JAXBException {
         JAXBContext context = createContext(type);
         return context.createUnmarshaller();
     }



Mime
View raw message