cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject cxf git commit: [CXF-7112]put Timer in AsyncHTTPConduitFactory
Date Sat, 29 Oct 2016 10:34:39 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 6ec0e90dc -> 5aa988b13


[CXF-7112]put Timer in AsyncHTTPConduitFactory

(cherry picked from commit 6031e2eb461a3439fbc3c8bec33fa74f84c7e7ca)


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

Branch: refs/heads/3.1.x-fixes
Commit: 5aa988b13f1a91a8bf4571bd9b84bc364c4d7e06
Parents: 6ec0e90
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Sat Oct 29 18:28:51 2016 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Sat Oct 29 18:29:27 2016 +0800

----------------------------------------------------------------------
 .../cxf/transport/http/asyncclient/AsyncHTTPConduit.java      | 7 ++-----
 .../transport/http/asyncclient/AsyncHTTPConduitFactory.java   | 2 ++
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5aa988b1/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
index bc1212f..bada797 100644
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
@@ -38,7 +38,6 @@ import java.security.cert.Certificate;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.Future;
 import java.util.logging.Level;
@@ -108,8 +107,7 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
     volatile SSLContext sslContext;
     volatile SSLSession session;
     volatile CloseableHttpAsyncClient client;
-    volatile Timer timer;
-    
+        
 
     public AsyncHTTPConduit(Bus b,
                             EndpointInfo ei, 
@@ -117,7 +115,6 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
                             AsyncHTTPConduitFactory factory) throws IOException {
         super(b, ei, t);
         this.factory = factory;
-        this.timer = new Timer();
     }
 
     public synchronized CloseableHttpAsyncClient getHttpAsyncClient() throws IOException
{
@@ -647,7 +644,7 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit {
         
         protected void handleResponseAsync() throws IOException {
             isAsync = true;
-            timer.schedule(new CheckReceiveTimeoutForAsync(), csPolicy.getReceiveTimeout());
+            factory.timer.schedule(new CheckReceiveTimeoutForAsync(), csPolicy.getReceiveTimeout());
         }
         
         protected void closeInputStream() throws IOException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/5aa988b1/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
index f905b92..d4ac6b1 100644
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
@@ -21,6 +21,7 @@ package org.apache.cxf.transport.http.asyncclient;
 
 import java.io.IOException;
 import java.util.Map;
+import java.util.Timer;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.cxf.Bus;
@@ -131,6 +132,7 @@ public class AsyncHTTPConduitFactory implements HTTPConduitFactory {
     int soTimeout = IOReactorConfig.DEFAULT.getSoTimeout();
     boolean soKeepalive = IOReactorConfig.DEFAULT.isSoKeepalive();
     boolean tcpNoDelay = true;
+    Timer timer = new Timer();
 
     AsyncHTTPConduitFactory() {
         super();


Mime
View raw message