cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6889] Checking the preconfigured ExecutorService
Date Tue, 11 Jul 2017 10:36:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 14e35b914 -> 706eacc5a


[CXF-6889] Checking the preconfigured ExecutorService


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

Branch: refs/heads/master
Commit: 706eacc5ae12e1c95085d2f8602c632c921e849e
Parents: 14e35b9
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Jul 11 11:36:08 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Jul 11 11:36:08 2017 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/client/spec/ClientImpl.java |  3 ++-
 .../cxf/jaxrs/client/spec/InvocationBuilderImpl.java | 15 ++++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/706eacc5/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
index 12649d8..b23d85e 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
@@ -306,7 +306,8 @@ public class ClientImpl implements Client {
                 cxfFeature.initialize(clientCfg, clientCfg.getBus());
             }
             // Start building the invocation
-            return new InvocationBuilderImpl(WebClient.fromClient(targetClient));
+            return new InvocationBuilderImpl(WebClient.fromClient(targetClient),
+                                             configImpl);
         }
         private void setConnectionProperties(Map<String, Object> configProps, ClientConfiguration
clientCfg) {
             Long connTimeOutValue = getLongValue(configProps.get(HTTP_CONNECTION_TIMEOUT_PROP));

http://git-wip-us.apache.org/repos/asf/cxf/blob/706eacc5/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
index a053f7f..ab5fa96 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/InvocationBuilderImpl.java
@@ -34,7 +34,9 @@ import javax.ws.rs.client.Invocation.Builder;
 import javax.ws.rs.client.InvocationCallback;
 import javax.ws.rs.client.RxInvoker;
 import javax.ws.rs.client.SyncInvoker;
+import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.Configurable;
 import javax.ws.rs.core.Cookie;
 import javax.ws.rs.core.GenericType;
 import javax.ws.rs.core.HttpHeaders;
@@ -53,10 +55,13 @@ public class InvocationBuilderImpl implements Invocation.Builder {
 
     private WebClient webClient;
     private SyncInvoker sync;
+    private Configurable<WebTarget> config;
 
-    public InvocationBuilderImpl(WebClient webClient) {
+    public InvocationBuilderImpl(WebClient webClient,
+                                 Configurable<WebTarget> config) {
         this.webClient = webClient;
         this.sync = webClient.sync();
+        this.config = config;
     }
 
     public WebClient getWebClient() {
@@ -376,13 +381,17 @@ public class InvocationBuilderImpl implements Invocation.Builder {
 
     @Override
     public CompletionStageRxInvoker rx() {
-        return webClient.rx((ExecutorService)null);
+        return webClient.rx(getConfiguredExecutorService());
     }
 
     @SuppressWarnings("rawtypes")
     @Override
     public <T extends RxInvoker> T rx(Class<T> rxCls) {
-        return webClient.rx(rxCls, (ExecutorService)null);
+        return webClient.rx(rxCls, getConfiguredExecutorService());
+    }
+
+    private ExecutorService getConfiguredExecutorService() {
+        return (ExecutorService)config.getConfiguration().getProperty("executorService");
     }
 
 }


Mime
View raw message