Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A27F7D39F for ; Tue, 5 Feb 2013 12:39:15 +0000 (UTC) Received: (qmail 4039 invoked by uid 500); 5 Feb 2013 12:39:15 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 3938 invoked by uid 500); 5 Feb 2013 12:39:13 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 3924 invoked by uid 99); 5 Feb 2013 12:39:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2013 12:39:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Feb 2013 12:39:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5E6FF2388ADA for ; Tue, 5 Feb 2013 12:38:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1442564 - in /httpcomponents/httpclient/branches/4.2.x: ./ httpclient/src/main/java/org/apache/http/impl/conn/ httpclient/src/test/java/org/apache/http/impl/conn/ Date: Tue, 05 Feb 2013 12:38:52 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130205123852.5E6FF2388ADA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Tue Feb 5 12:38:51 2013 New Revision: 1442564 URL: http://svn.apache.org/viewvc?rev=1442564&view=rev Log: PoolingClientConnectionManager does not use ClientConnectionOperator#createConnection() method to create new connections Modified: httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/ConnPoolBench.java Modified: httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt?rev=1442564&r1=1442563&r2=1442564&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt (original) +++ httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt Tue Feb 5 12:38:51 2013 @@ -1,6 +1,10 @@ Changes since Release 4.2.3 ------------------- +* PoolingClientConnectionManager does not use ClientConnectionOperator#createConnection() + method to create new connections. + Contributed by Oleg Kalnichevski + * [HTTPCLIENT-1311] Interrupt flag is not preserved where InterruptedException is caught. Contributed by Oleg Kalnichevski Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java?rev=1442564&r1=1442563&r2=1442564&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java (original) +++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java Tue Feb 5 12:38:51 2013 @@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.apache.commons.logging.Log; +import org.apache.http.conn.ClientConnectionOperator; import org.apache.http.conn.OperatedClientConnection; import org.apache.http.conn.routing.HttpRoute; import org.apache.http.pool.AbstractConnPool; @@ -48,9 +49,10 @@ class HttpConnPool extends AbstractConnP private final TimeUnit tunit; public HttpConnPool(final Log log, + final ClientConnectionOperator connOperator, final int defaultMaxPerRoute, final int maxTotal, final long timeToLive, final TimeUnit tunit) { - super(new InternalConnFactory(), defaultMaxPerRoute, maxTotal); + super(new InternalConnFactory(connOperator), defaultMaxPerRoute, maxTotal); this.log = log; this.timeToLive = timeToLive; this.tunit = tunit; @@ -64,8 +66,14 @@ class HttpConnPool extends AbstractConnP static class InternalConnFactory implements ConnFactory { + private final ClientConnectionOperator connOperator; + + InternalConnFactory(final ClientConnectionOperator connOperator) { + this.connOperator = connOperator; + } + public OperatedClientConnection create(final HttpRoute route) throws IOException { - return new DefaultClientConnection(); + return connOperator.createConnection(); } } Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java?rev=1442564&r1=1442563&r2=1442564&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java (original) +++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java Tue Feb 5 12:38:51 2013 @@ -112,7 +112,7 @@ public class PoolingClientConnectionMana this.schemeRegistry = schemeRegistry; this.dnsResolver = dnsResolver; this.operator = createConnectionOperator(schemeRegistry); - this.pool = new HttpConnPool(this.log, 2, 20, timeToLive, tunit); + this.pool = new HttpConnPool(this.log, this.operator, 2, 20, timeToLive, tunit); } @Override Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/ConnPoolBench.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/ConnPoolBench.java?rev=1442564&r1=1442563&r2=1442564&view=diff ============================================================================== --- httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/ConnPoolBench.java (original) +++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/test/java/org/apache/http/impl/conn/ConnPoolBench.java Tue Feb 5 12:38:51 2013 @@ -58,7 +58,9 @@ public class ConnPoolBench { public static void newPool(int c, long reps) throws Exception { Log log = LogFactory.getLog(ConnPoolBench.class); - HttpConnPool pool = new HttpConnPool(log, c, c * 10, -1, TimeUnit.MILLISECONDS); + DefaultClientConnectionOperator connOperator = new DefaultClientConnectionOperator( + SchemeRegistryFactory.createDefault()); + HttpConnPool pool = new HttpConnPool(log, connOperator, c, c * 10, -1, TimeUnit.MILLISECONDS); WorkerThread1[] workers = new WorkerThread1[c]; for (int i = 0; i < workers.length; i++) {