You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/12/15 02:14:49 UTC

svn commit: r1214586 - /commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java

Author: sebb
Date: Thu Dec 15 01:14:48 2011
New Revision: 1214586

URL: http://svn.apache.org/viewvc?rev=1214586&view=rev
Log:
Javadoc

Modified:
    commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java

Modified: commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java?rev=1214586&r1=1214585&r2=1214586&view=diff
==============================================================================
--- commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java (original)
+++ commons/proper/pool/trunk/src/java/org/apache/commons/pool2/impl/GenericKeyedObjectPool.java Thu Dec 15 01:14:48 2011
@@ -1465,6 +1465,17 @@ public class GenericKeyedObjectPool<K,T>
         }
     }
 
+    /**
+     * Registers a new key in the {@link poolMap} and {@link poolKeyList}
+     * and returns the key queue details.
+     * If the key is already in the map, increments the interest count and 
+     * returns the existing details.
+     * <p>
+     * register and deregister must be used as a pair.
+     * @param k the key to register
+     * @return the key queue details
+     * @see #deregister(Object)
+     */
     private ObjectDeque<T> register(K k) {
         Lock lock = keyLock.readLock();
         ObjectDeque<T> objectDeque = null;
@@ -1494,6 +1505,17 @@ public class GenericKeyedObjectPool<K,T>
         return objectDeque;
     }
     
+    /**
+     * Deregisters an unused key from {@link poolMap} and {@link poolKeyList}.
+     * Fetches the key and decrements the interest count; if this is zero,
+     * and the number of managed instances is zero, then the key is removed.
+     * <p>
+     * register and deregister must be used as a pair.
+     * 
+     * @param k the key to deregister
+     * @throws NullPointerException if the key is not in the {@link poolMap}
+     * @see #register(Object)
+     */
     private void deregister(K k) {
         ObjectDeque<T> objectDeque;