Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A442E200BC8 for ; Tue, 8 Nov 2016 08:56:44 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A2DD8160AFA; Tue, 8 Nov 2016 07:56:44 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C727B160B15 for ; Tue, 8 Nov 2016 08:56:43 +0100 (CET) Received: (qmail 16796 invoked by uid 500); 8 Nov 2016 07:56:43 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 16082 invoked by uid 99); 8 Nov 2016 07:56:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 07:56:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 122E8E3A9C; Tue, 8 Nov 2016 07:56:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ffang@apache.org To: commits@cxf.apache.org Date: Tue, 08 Nov 2016 07:56:47 -0000 Message-Id: <68d806c70ad44bd3877377a2135e3433@git.apache.org> In-Reply-To: <13ba1f63dd374c7eabde3ee3230fbefb@git.apache.org> References: <13ba1f63dd374c7eabde3ee3230fbefb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [7/7] cxf git commit: [CXF-7122]remove unnecessary Timer archived-at: Tue, 08 Nov 2016 07:56:44 -0000 [CXF-7122]remove unnecessary Timer Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/caac8616 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/caac8616 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/caac8616 Branch: refs/heads/master Commit: caac861613b4df07eb3ff4023e1b9e53b07cd5ea Parents: e55ea14 Author: Freeman Fang Authored: Tue Nov 8 15:56:18 2016 +0800 Committer: Freeman Fang Committed: Tue Nov 8 15:56:18 2016 +0800 ---------------------------------------------------------------------- .../http/asyncclient/AsyncHTTPConduit.java | 25 -------------------- .../asyncclient/AsyncHTTPConduitFactory.java | 3 +-- .../http/asyncclient/SharedOutputBuffer.java | 1 - 3 files changed, 1 insertion(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/caac8616/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 7123ee9..4b4b934 100755 --- 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.TimerTask; import java.util.concurrent.Future; import java.util.logging.Level; @@ -53,13 +52,11 @@ import org.apache.cxf.Bus; import org.apache.cxf.common.util.StringUtils; import org.apache.cxf.configuration.jsse.SSLUtils; import org.apache.cxf.configuration.jsse.TLSClientParameters; -import org.apache.cxf.endpoint.ClientCallback; import org.apache.cxf.helpers.HttpHeaderHelper; import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.io.CacheAndWriteOutputStream; import org.apache.cxf.io.CachedOutputStream; import org.apache.cxf.io.CopyingOutputStream; -import org.apache.cxf.message.Exchange; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageUtils; import org.apache.cxf.service.model.EndpointInfo; @@ -650,7 +647,6 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit { protected void handleResponseAsync() throws IOException { isAsync = true; -// factory.timer.schedule(new CheckReceiveTimeoutForAsync(), csPolicy.getReceiveTimeout()); } protected void closeInputStream() throws IOException { @@ -867,29 +863,8 @@ public class AsyncHTTPConduit extends URLConnectionHTTPConduit { } } - class CheckReceiveTimeoutForAsync extends TimerTask { - public void run() { - - if (httpResponse == null) { - outbuf.shutdown(); - inbuf.shutdown(); - if (exception != null) { - throw new RuntimeException(exception); - } - - Exchange exchange = outMessage.getExchange(); - // remove callback so that it won't be invoked twice - ClientCallback cc = exchange.remove(ClientCallback.class); - if (cc != null) { - cc.handleException(null, new SocketTimeoutException()); - } - } - } - } - } - public synchronized SSLContext getSSLContext(TLSClientParameters tlsClientParameters) throws GeneralSecurityException { http://git-wip-us.apache.org/repos/asf/cxf/blob/caac8616/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 d4ac6b1..ba0c2ea 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,7 +21,6 @@ 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; @@ -132,7 +131,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(); http://git-wip-us.apache.org/repos/asf/cxf/blob/caac8616/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java ---------------------------------------------------------------------- diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java index 49cb9d6..1e3ed96 100644 --- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java +++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/SharedOutputBuffer.java @@ -118,7 +118,6 @@ public class SharedOutputBuffer extends ExpandableBuffer { public int produceContent(final ContentEncoder encoder, final IOControl ioc) throws IOException { if (this.shutdown) { - encoder.complete(); return -1; } this.lock.lock();