cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Few updates to JAXRS client proxy async code
Date Wed, 08 Jun 2016 14:46:52 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes a1e91a05d -> 163e1d236


Few updates to JAXRS client proxy async code


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

Branch: refs/heads/3.1.x-fixes
Commit: 163e1d2361643251b31b6fdf7def0b52542577dd
Parents: a1e91a0
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Jun 8 15:45:47 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Jun 8 15:46:30 2016 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/client/ClientProxyImpl.java       | 31 ++++++--------------
 1 file changed, 9 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/163e1d23/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 1e1d427..c5bb980 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
@@ -793,8 +793,7 @@ public class ClientProxyImpl extends AbstractClient implements
         Class<?> callbackRespClass = getCallbackClass(callbackOutType);
         
         Class<?> methodReturnType = ori.getMethodToInvoke().getReturnType();
-        if (callbackRespClass == Response.class 
-            || callbackRespClass.isAssignableFrom(methodReturnType)
+        if (callbackRespClass.isAssignableFrom(methodReturnType)
             || PrimitiveUtils.canPrimitiveTypeBeAutoboxed(methodReturnType, callbackRespClass))
{
             return callback;    
         } else {
@@ -949,28 +948,16 @@ public class ClientProxyImpl extends AbstractClient implements
     class ClientAsyncResponseInterceptor extends AbstractClientAsyncResponseInterceptor {
         @Override
         protected void doHandleAsyncResponse(Message message, Response r, JaxrsClientCallback<?>
cb) {
-            Object entity = null;
-            if (r == null) {
-                try {
-                    entity = handleResponse(message.getExchange().getOutMessage(),
-                                            cb.getResponseClass());
-                } catch (Throwable t) {
-                    cb.handleException(message, t);
-                    return;
-                } finally {
-                    completeExchange(message.getExchange(), false);
-                }
-            }
-            if (cb.getResponseClass() == null || Response.class.equals(cb.getResponseClass()))
{
-                cb.handleResponse(message, new Object[] {r});
-            } else if (r != null && r.getStatus() >= 300) {
-                cb.handleException(message, convertToWebApplicationException(r));
-            } else {
-                cb.handleResponse(message, new Object[] {entity});
+            try {
+                Object entity = handleResponse(message.getExchange().getOutMessage(),
+                                               cb.getResponseClass());
+                cb.handleResponse(message, new Object[] {entity});    
+            } catch (Throwable t) {
+                cb.handleException(message, t);
+            } finally {
+                completeExchange(message.getExchange(), false);
                 closeAsyncResponseIfPossible(r, message, cb);
             }
         }
-        
-        
     }
 }


Mime
View raw message