Return-Path: Delivered-To: apmail-jakarta-avalon-cvs-archive@apache.org Received: (qmail 60710 invoked from network); 7 Feb 2002 08:09:54 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Feb 2002 08:09:54 -0000 Received: (qmail 29113 invoked by uid 97); 7 Feb 2002 08:10:07 -0000 Delivered-To: qmlist-jakarta-archive-avalon-cvs@jakarta.apache.org Received: (qmail 29065 invoked by uid 97); 7 Feb 2002 08:10:06 -0000 Mailing-List: contact avalon-cvs-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon CVS List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-cvs@jakarta.apache.org Received: (qmail 29054 invoked by uid 97); 7 Feb 2002 08:10:06 -0000 Date: 7 Feb 2002 08:09:51 -0000 Message-ID: <20020207080951.11441.qmail@icarus.apache.org> From: leif@apache.org To: jakarta-avalon-excalibur-cvs@apache.org Subject: cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/pool ResourceLimitingPool.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N leif 02/02/07 00:09:51 Modified: src/scratchpad/org/apache/avalon/excalibur/pool ResourceLimitingPool.java Log: Added more descriptive JavaDocs Revision Changes Path 1.3 +11 -8 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/pool/ResourceLimitingPool.java Index: ResourceLimitingPool.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/pool/ResourceLimitingPool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ResourceLimitingPool.java 25 Jan 2002 01:24:27 -0000 1.2 +++ ResourceLimitingPool.java 7 Feb 2002 08:09:50 -0000 1.3 @@ -25,15 +25,15 @@ * General Pool implementation which supports; weak and strong pool size limits, * optional blocking gets when poolables are not available, and automatic pool * trimming of unused poolables. - * + *

* Whenever get() is called, the pool tests to see whether it is time to trim old * poolables from the pool. If any old poolables exist then they are removed at * this time. This means that old poolables will not be removed if get() is never * called. Applications can optionally call trim() to force old objects to be - * trimmed. See the trim() method for details of how trimming works. + * trimmed. See the {@link #trim()} method for details of how trimming works. * * @author Leif Mortenson - * @version CVS $Revision: 1.2 $ $Date: 2002/01/25 01:24:27 $ + * @version CVS $Revision: 1.3 $ $Date: 2002/02/07 08:09:50 $ * @since 4.1 */ public class ResourceLimitingPool @@ -449,6 +449,7 @@ /** * Permanently removes a poolable from the pool's active list and * destroys it so that it will not ever be reused. + *

* This method is only called by threads that have m_semaphore locked. */ protected void permanentlyRemovePoolable( Poolable poolable ) @@ -479,8 +480,10 @@ /** * Create a new poolable instance by by calling the newInstance method * on the pool's ObjectFactory. + *

* This is the method to override when you need to enforce creational * policies. + *

* This method is only called by threads that have m_semaphore locked. */ protected Poolable newPoolable() throws Exception @@ -493,7 +496,7 @@ * Called when an object is being removed permanently from the pool. * This is the method to override when you need to enforce destructional * policies. - * + *

* This method is only called by threads that have m_semaphore locked. * * @param poolable Poolable to be completely removed from the pool. @@ -519,22 +522,22 @@ * be called at that interval when get() is called. If get() is not called * for long periods of time then if may be necessary to call this method * manually. - * + *

* Trimming is done by maintaing two lists of objects. The first is a ready list * of new poolables. The second is a list of old poolables. Each time trim() is * called, the contents of the old list are removed from the pool. Then the * contents of the new list is moved into the old list. - * + *

* Each time get() is called on the pool, the new list is checked first, then the * old list is checked, finally a new poolable may be created if both lists are * empty. Then whenever put() is called, the poolables are always returned to * the new list. In this way, the need for maining time stamps for each poolable * can be avoided while at the same time avoiding unnecessary removal and creation * on poolables. - * + *

* This works out to a poolable having a maximum idle time of two calls to trim() or * twice the value of trimInterval. - * + *

* NOTE - The trimming feature does not harm performance because pools with high * load will not have old poolables to be trimmed, and the benefits to system * resources from not keeping around unused poolables makes up for any hit. -- To unsubscribe, e-mail: For additional commands, e-mail: