hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1155307 - in /httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn: HttpConnPool.java HttpPoolEntry.java
Date Tue, 09 Aug 2011 11:09:00 GMT
Author: olegk
Date: Tue Aug  9 11:08:59 2011
New Revision: 1155307

URL: http://svn.apache.org/viewvc?rev=1155307&view=rev
Log:
Moved pool entry ID generation logic from abstract pool classes to specific implementations

Modified:
    httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java
    httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpPoolEntry.java

Modified: httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java?rev=1155307&r1=1155306&r2=1155307&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java
(original)
+++ httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java
Tue Aug  9 11:08:59 2011
@@ -28,6 +28,7 @@ package org.apache.http.impl.conn;
 
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.commons.logging.Log;
 import org.apache.http.HttpConnection;
@@ -40,6 +41,8 @@ import org.apache.http.pool.AbstractConn
  */
 class HttpConnPool extends AbstractConnPool<HttpRoute, OperatedClientConnection, HttpPoolEntry>
{
 
+    private static AtomicLong COUNTER = new AtomicLong();
+
     private final Log log;
     private final long timeToLive;
     private final TimeUnit tunit;
@@ -60,7 +63,8 @@ class HttpConnPool extends AbstractConnP
 
     @Override
     protected HttpPoolEntry createEntry(final HttpRoute route, final OperatedClientConnection
conn) {
-        return new HttpPoolEntry(this.log, route, conn, this.timeToLive, this.tunit);
+        String id = Long.toString(COUNTER.getAndIncrement());
+        return new HttpPoolEntry(this.log, id, route, conn, this.timeToLive, this.tunit);
     }
 
     @Override

Modified: httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpPoolEntry.java?rev=1155307&r1=1155306&r2=1155307&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpPoolEntry.java
(original)
+++ httpcomponents/httpclient/branches/conn-mgmt-redesign/httpclient/src/main/java/org/apache/http/impl/conn/HttpPoolEntry.java
Tue Aug  9 11:08:59 2011
@@ -45,10 +45,11 @@ class HttpPoolEntry extends PoolEntry<Ht
 
     public HttpPoolEntry(
             final Log log,
+            final String id,
             final HttpRoute route,
             final OperatedClientConnection conn,
             final long timeToLive, final TimeUnit tunit) {
-        super(route, conn, timeToLive, tunit);
+        super(id, route, conn, timeToLive, tunit);
         this.log = log;
         this.tracker = new RouteTracker(route);
     }



Mime
View raw message