cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1544269 - in /cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client: WebClient.java spec/ClientImpl.java spec/InvocationBuilderImpl.java
Date Thu, 21 Nov 2013 18:02:05 GMT
Author: sergeyb
Date: Thu Nov 21 18:02:04 2013
New Revision: 1544269

URL: http://svn.apache.org/r1544269
Log:
Updating WebClient to let JAX-RS 2.0 WebClient or InvocationBuilder to get to the lower-level
CXF configuration too

Modified:
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=1544269&r1=1544268&r2=1544269&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java (original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java Thu Nov
21 18:02:04 2013
@@ -55,6 +55,8 @@ import org.apache.cxf.bus.spring.SpringB
 import org.apache.cxf.feature.Feature;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.jaxrs.client.spec.ClientImpl.WebTargetImpl;
+import org.apache.cxf.jaxrs.client.spec.InvocationBuilderImpl;
 import org.apache.cxf.jaxrs.impl.ResponseImpl;
 import org.apache.cxf.jaxrs.impl.UriBuilderImpl;
 import org.apache.cxf.jaxrs.model.ParameterType;
@@ -269,11 +271,17 @@ public class WebClient extends AbstractC
     }
     
     /**
-     * Retieves ClientConfiguration
+     * Retrieves ClientConfiguration
      * @param client proxy or http-centric Client
      * @return underlying ClientConfiguration instance 
      */
     public static ClientConfiguration getConfig(Object client) {
+        if (client instanceof WebTargetImpl) {
+            client = ((WebTargetImpl)client).getWebClient();
+        } else if (client instanceof InvocationBuilderImpl) {
+            client = ((InvocationBuilderImpl)client).getWebClient();
+        } 
+        
         if (client instanceof Client) {
             if (client instanceof WebClient) { 
                 return ((AbstractClient)client).getConfiguration();

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java?rev=1544269&r1=1544268&r2=1544269&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
(original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
Thu Nov 21 18:02:04 2013
@@ -225,6 +225,10 @@ public class ClientImpl implements Clien
             this.targetClient = targetClient;
         }
         
+        public WebClient getWebClient() {
+            return this.targetClient;
+        }
+        
         @Override
         public Builder request() {
             checkClosed();

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java?rev=1544269&r1=1544268&r2=1544269&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
(original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
Thu Nov 21 18:02:04 2013
@@ -56,6 +56,10 @@ public class InvocationBuilderImpl imple
         this.sync = webClient.sync();
     }
     
+    public WebClient getWebClient() {
+        return this.webClient;
+    }
+    
     @Override
     public Response delete() {
         return sync.delete();



Mime
View raw message