cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1391381 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Date Fri, 28 Sep 2012 10:11:54 GMT
Author: sergeyb
Date: Fri Sep 28 10:11:54 2012
New Revision: 1391381

URL: http://svn.apache.org/viewvc?rev=1391381&view=rev
Log:
[CXF-4455] Excluding AsyncResponse in client proxies

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=1391381&r1=1391380&r2=1391381&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
Fri Sep 28 10:11:54 2012
@@ -38,6 +38,7 @@ import java.util.ResourceBundle;
 import java.util.logging.Logger;
 
 import javax.ws.rs.client.ClientException;
+import javax.ws.rs.container.AsyncResponse;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
@@ -222,8 +223,7 @@ public class ClientProxyImpl extends Abs
         int requestBodyParam = 0;
         int multipartParam = 0;
         for (Parameter p : parameters) {
-            if (p.getType() == ParameterType.CONTEXT) {
-                // ignore
+            if (isIgnorableParameter(ori, p)) {
                 continue;
             }
             if (p.getType() == ParameterType.REQUEST_BODY) {
@@ -246,6 +246,20 @@ public class ClientProxyImpl extends Abs
         return map;
     }
     
+    private static boolean isIgnorableParameter(OperationResourceInfo ori, Parameter p) {
+        if (p.getType() == ParameterType.CONTEXT) {
+            return true;
+        }
+        if (p.getType() == ParameterType.REQUEST_BODY) { 
+            Method m = ori.getAnnotatedMethod();
+            if (m != null 
+                && m.getParameterTypes()[p.getIndex()] == AsyncResponse.class) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
     private static int getBodyIndex(MultivaluedMap<ParameterType, Parameter> map, 
                                     OperationResourceInfo ori) {
         List<Parameter> list = map.get(ParameterType.REQUEST_BODY);



Mime
View raw message