Repository: cxf Updated Branches: refs/heads/master 33b379da7 -> 6031e2eb4
[CXF-7112]put Timer in AsyncHTTPConduitFactory Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6031e2eb Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6031e2eb Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6031e2eb Branch: refs/heads/master Commit: 6031e2eb461a3439fbc3c8bec33fa74f84c7e7ca Parents: 33b379d Author: Freeman Fang <[email protected]> Authored: Sat Oct 29 18:28:51 2016 +0800 Committer: Freeman Fang <[email protected]> Committed: Sat Oct 29 18:28:51 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/6031e2eb/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/6031e2eb/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();
