cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1070034 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
Date Sat, 12 Feb 2011 06:52:54 GMT
Author: ningjiang
Date: Sat Feb 12 06:52:54 2011
New Revision: 1070034

URL: http://svn.apache.org/viewvc?rev=1070034&view=rev
Log:
CXF-3332 Fixed the issue of SourceDataBinding doesn't create a thread safe DataReader.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java?rev=1070034&r1=1070033&r2=1070034&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
Sat Feb 12 06:52:54 2011
@@ -35,18 +35,8 @@ public class SourceDataBinding extends o
     
     public static final String PREFERRED_FORMAT = "source-preferred-format";
 
-    private XMLStreamDataReader xsrReader;
-    private XMLStreamDataWriter xswWriter;
-    private NodeDataWriter nodeWriter;
-    private NodeDataReader nodeReader;
-
     public SourceDataBinding() {
         super();
-        this.xsrReader = new XMLStreamDataReader();
-        this.xswWriter = new XMLStreamDataWriter();
-
-        this.nodeReader = new NodeDataReader();
-        this.nodeWriter = new NodeDataWriter();
     }
 
     public void initialize(Service service) {
@@ -57,9 +47,9 @@ public class SourceDataBinding extends o
     @SuppressWarnings("unchecked")
     public <T> DataReader<T> createReader(Class<T> cls) {
         if (cls == XMLStreamReader.class) {
-            return (DataReader<T>) xsrReader;
+            return (DataReader<T>) new XMLStreamDataReader();
         } else if (cls == Node.class) {
-            return (DataReader<T>) nodeReader;
+            return (DataReader<T>) new NodeDataReader();
         } else {
             throw new UnsupportedOperationException("The type " + cls.getName() + " is not
supported.");
         }
@@ -72,9 +62,9 @@ public class SourceDataBinding extends o
     @SuppressWarnings("unchecked")
     public <T> DataWriter<T> createWriter(Class<T> cls) {
         if (cls == XMLStreamWriter.class) {
-            return (DataWriter<T>) xswWriter;
+            return (DataWriter<T>) new XMLStreamDataWriter();
         } else if (cls == Node.class) {
-            return (DataWriter<T>) nodeWriter;
+            return (DataWriter<T>) new NodeDataWriter();
         } else {
             throw new UnsupportedOperationException("The type " + cls.getName() + " is not
supported.");
         }



Mime
View raw message