hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1054963 - in /httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool: RouteSpecificPool.java SessionPool.java SessionPoolForRoute.java
Date Tue, 04 Jan 2011 10:37:55 GMT
Author: olegk
Date: Tue Jan  4 10:37:55 2011
New Revision: 1054963

URL: http://svn.apache.org/viewvc?rev=1054963&view=rev
Log:
Renamed class

Added:
    httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/RouteSpecificPool.java
      - copied, changed from r1054962, httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPoolForRoute.java
Removed:
    httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPoolForRoute.java
Modified:
    httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPool.java

Copied: httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/RouteSpecificPool.java
(from r1054962, httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPoolForRoute.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/RouteSpecificPool.java?p2=httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/RouteSpecificPool.java&p1=httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPoolForRoute.java&r1=1054962&r2=1054963&rev=1054963&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPoolForRoute.java
(original)
+++ httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/RouteSpecificPool.java
Tue Jan  4 10:37:55 2011
@@ -37,7 +37,7 @@ import java.util.Set;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.SessionRequest;
 
-class SessionPoolForRoute<T, E extends PoolEntry<T>> {
+class RouteSpecificPool<T, E extends PoolEntry<T>> {
 
     private final T route;
     private final PoolEntryFactory<T, E> factory;
@@ -45,7 +45,7 @@ class SessionPoolForRoute<T, E extends P
     private final LinkedList<E> availableSessions;
     private final Map<SessionRequest, PoolEntryCallback<T, E>> pendingSessions;
 
-    public SessionPoolForRoute(final T route, final PoolEntryFactory<T, E> factory)
{
+    public RouteSpecificPool(final T route, final PoolEntryFactory<T, E> factory) {
         super();
         this.route = route;
         this.factory = factory;

Modified: httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPool.java?rev=1054963&r1=1054962&r2=1054963&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPool.java
(original)
+++ httpcomponents/httpasyncclient/trunk/src/main/java/org/apache/http/impl/nio/pool/SessionPool.java
Tue Jan  4 10:37:55 2011
@@ -49,7 +49,7 @@ public abstract class SessionPool<T, E e
     private final PoolEntryFactory<T, E> factory;
     private final SessionRequestCallback sessionRequestCallback;
     private final RouteResolver<T> routeResolver;
-    private final Map<T, SessionPoolForRoute<T, E>> routeToPool;
+    private final Map<T, RouteSpecificPool<T, E>> routeToPool;
     private final LinkedList<LeaseRequest<T, E>> leasingRequests;
     private final Set<SessionRequest> pendingSessions;
     private final Set<PoolEntry<T>> leasedSessions;
@@ -81,7 +81,7 @@ public abstract class SessionPool<T, E e
         this.factory = factory;
         this.sessionRequestCallback = new InternalSessionRequestCallback();
         this.routeResolver = routeResolver;
-        this.routeToPool = new HashMap<T, SessionPoolForRoute<T, E>>();
+        this.routeToPool = new HashMap<T, RouteSpecificPool<T, E>>();
         this.leasingRequests = new LinkedList<LeaseRequest<T, E>>();
         this.pendingSessions = new HashSet<SessionRequest>();
         this.leasedSessions = new HashSet<PoolEntry<T>>();
@@ -99,7 +99,7 @@ public abstract class SessionPool<T, E e
         this.isShutDown = true;
         this.lock.lock();
         try {
-            for (SessionPoolForRoute<T, E> pool: this.routeToPool.values()) {
+            for (RouteSpecificPool<T, E> pool: this.routeToPool.values()) {
                 pool.shutdown();
             }
             this.routeToPool.clear();
@@ -113,10 +113,10 @@ public abstract class SessionPool<T, E e
         }
     }
 
-    private SessionPoolForRoute<T, E> getPool(final T route) {
-        SessionPoolForRoute<T, E> pool = this.routeToPool.get(route);
+    private RouteSpecificPool<T, E> getPool(final T route) {
+        RouteSpecificPool<T, E> pool = this.routeToPool.get(route);
         if (pool == null) {
-            pool = new SessionPoolForRoute<T, E>(route, this.factory);
+            pool = new RouteSpecificPool<T, E>(route, this.factory);
             this.routeToPool.put(route, pool);
         }
         return pool;
@@ -157,7 +157,7 @@ public abstract class SessionPool<T, E e
         this.lock.lock();
         try {
             if (this.leasedSessions.remove(entry)) {
-                SessionPoolForRoute<T, E> pool = getPool(entry.getRoute());
+                RouteSpecificPool<T, E> pool = getPool(entry.getRoute());
                 pool.freeEntry(entry, reusable);
                 if (reusable) {
                     this.availableSessions.add(entry);
@@ -196,12 +196,12 @@ public abstract class SessionPool<T, E e
                 if (!this.availableSessions.isEmpty()) {
                     E entry = this.availableSessions.remove();
                     entryShutdown(entry);
-                    SessionPoolForRoute<T, E> pool = getPool(entry.getRoute());
+                    RouteSpecificPool<T, E> pool = getPool(entry.getRoute());
                     pool.freeEntry(entry, false);
                 }
             }
 
-            SessionPoolForRoute<T, E> pool = getPool(request.getRoute());
+            RouteSpecificPool<T, E> pool = getPool(request.getRoute());
             E entry = pool.getFreeEntry(state);
             if (entry != null) {
                 it.remove();
@@ -240,7 +240,7 @@ public abstract class SessionPool<T, E e
         this.lock.lock();
         try {
             this.pendingSessions.remove(request);
-            SessionPoolForRoute<T, E> pool = getPool(route);
+            RouteSpecificPool<T, E> pool = getPool(route);
             PoolEntry<T> entry = pool.completed(request);
             this.leasedSessions.add(entry);
         } finally {
@@ -257,7 +257,7 @@ public abstract class SessionPool<T, E e
         this.lock.lock();
         try {
             this.pendingSessions.remove(request);
-            SessionPoolForRoute<T, E> pool = getPool(route);
+            RouteSpecificPool<T, E> pool = getPool(route);
             pool.cancelled(request);
         } finally {
             this.lock.unlock();
@@ -273,7 +273,7 @@ public abstract class SessionPool<T, E e
         this.lock.lock();
         try {
             this.pendingSessions.remove(request);
-            SessionPoolForRoute<T, E> pool = getPool(route);
+            RouteSpecificPool<T, E> pool = getPool(route);
             pool.failed(request);
         } finally {
             this.lock.unlock();
@@ -289,7 +289,7 @@ public abstract class SessionPool<T, E e
         this.lock.lock();
         try {
             this.pendingSessions.remove(request);
-            SessionPoolForRoute<T, E> pool = getPool(route);
+            RouteSpecificPool<T, E> pool = getPool(route);
             pool.timeout(request);
         } finally {
             this.lock.unlock();
@@ -363,7 +363,7 @@ public abstract class SessionPool<T, E e
         }
         this.lock.lock();
         try {
-            SessionPoolForRoute<T, E> pool = getPool(route);
+            RouteSpecificPool<T, E> pool = getPool(route);
             return new PoolStats(
                     pool.getLeasedCount(),
                     pool.getPendingCount(),



Mime
View raw message