cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-6045] Changing the way BodyWriters are registered and fixing the test faiures
Date Tue, 14 Oct 2014 10:04:05 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes d54014582 -> ffbd7bde5


[CXF-6045] Changing the way BodyWriters are registered and fixing the test faiures


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

Branch: refs/heads/3.0.x-fixes
Commit: ffbd7bde505d7f7ef6313801faf96b16a8d5551d
Parents: d540145
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Oct 14 11:02:20 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Oct 14 11:03:26 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java   | 4 ++--
 .../src/main/java/org/apache/cxf/jaxrs/client/WebClient.java     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ffbd7bde/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
index 09c7766..f18530f 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
@@ -96,7 +96,7 @@ public class ClientProxyImpl extends AbstractClient implements
     private boolean inheritHeaders;
     private boolean isRoot;
     private Map<String, Object> valuesMap = Collections.emptyMap();
-    
+    private BodyWriter bodyWriter = new BodyWriter();
     public ClientProxyImpl(URI baseURI,
                            ClassLoader loader,
                            ClassResourceInfo cri, 
@@ -118,7 +118,6 @@ public class ClientProxyImpl extends AbstractClient implements
         this.isRoot = isRoot;
         this.inheritHeaders = inheritHeaders;
         initValuesMap(varValues);
-        cfg.getOutInterceptors().add(new BodyWriter());
     }
     
     private void initValuesMap(Object... varValues) {
@@ -665,6 +664,7 @@ public class ClientProxyImpl extends AbstractClient implements
             if (body != null) {
                 outMessage.put("BODY_INDEX", bodyIndex);
             }
+            outMessage.getInterceptorChain().add(bodyWriter);
             
             Map<String, Object> reqContext = getRequestContext(outMessage);
             reqContext.put(OperationResourceInfo.class.getName(), ori);

http://git-wip-us.apache.org/repos/asf/cxf/blob/ffbd7bde/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
index a266102..f183ab2 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
@@ -84,7 +84,7 @@ public class WebClient extends AbstractClient {
     private static final String REQUEST_ANNS = "request.annotations";
     private static final String RESPONSE_CLASS = "response.class";
     private static final String RESPONSE_TYPE = "response.type";
-    
+    private BodyWriter bodyWriter = new BodyWriter();
     protected WebClient(String baseAddress) {
         this(convertStringToURI(baseAddress));
     }
@@ -96,7 +96,6 @@ public class WebClient extends AbstractClient {
     protected WebClient(ClientState state) {
         super(state);
         cfg.getInInterceptors().add(new ClientAsyncResponseInterceptor());
-        cfg.getOutInterceptors().add(new BodyWriter());
     }
     
     
@@ -1124,6 +1123,7 @@ public class WebClient extends AbstractClient {
         if (body != null) {
             m.put(Type.class, inGenericType);
         }
+        m.getInterceptorChain().add(bodyWriter);
         setPlainOperationNameProperty(m, httpMethod + ":" + uri.toString());
         return m;
     }


Mime
View raw message