Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 40469 invoked from network); 25 Nov 2004 20:09:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Nov 2004 20:09:58 -0000 Received: (qmail 82698 invoked by uid 500); 25 Nov 2004 20:09:55 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 82676 invoked by uid 500); 25 Nov 2004 20:09:55 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 82660 invoked by uid 500); 25 Nov 2004 20:09:55 -0000 Received: (qmail 82651 invoked by uid 99); 25 Nov 2004 20:09:55 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 25 Nov 2004 12:09:54 -0800 Received: (qmail 40428 invoked by uid 1289); 25 Nov 2004 20:09:53 -0000 Date: 25 Nov 2004 20:09:53 -0000 Message-ID: <20041125200953.40427.qmail@minotaur.apache.org> From: rdonkin@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/logging/optional/src/java/org/apache/commons/logging/impl WeakHashtable.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N rdonkin 2004/11/25 12:09:53 Modified: logging/optional/src/java/org/apache/commons/logging/impl WeakHashtable.java Log: Class level documentation. Contributed by Brian Stansberry Revision Changes Path 1.5 +27 -2 jakarta-commons/logging/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java Index: WeakHashtable.java =================================================================== RCS file: /home/cvs/jakarta-commons/logging/optional/src/java/org/apache/commons/logging/impl/WeakHashtable.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- WeakHashtable.java 17 Nov 2004 23:23:21 -0000 1.4 +++ WeakHashtable.java 25 Nov 2004 20:09:53 -0000 1.5 @@ -35,9 +35,34 @@ *

* Usage: typical use case is as a drop-in replacement * for the Hashtable use in LogFactory for J2EE enviroments - * running 1.3+ JVMs. Use of this class will allow classloaders to be collected by - * the garbage collector without the need to call release. + * running 1.3+ JVMs. Use of this class in most cases (see below) will + * allow classloaders to be collected by the garbage collector without the need + * to call {@link org.apache.commons.logging.LogFactory#release(ClassLoader) LogFactory.release(ClassLoader)}. *

+ *

+ * In a particular usage scenario, use of WeakHashtable alone will + * be insufficent to allow garbage collection of a classloader without a call to + * release. If the abstract class LogFactory is + * loaded by a parent classloader and a concrete subclass implementation of + * LogFactory is loaded by a child classloader, the concrete + * implementation will have a strong reference to the child classloader via the + * chain getClass().getClassLoader(). The WeakHashtable + * will have a strong reference to the LogFactory implementation as + * one of the values in its map. This chain of references will prevent + * collection of the child classloader. + *

+ *

+ * Such a situation would typically only occur if commons-logging.jar were + * loaded by a parent classloader (e.g. a server level classloader in a + * servlet container) and a custom LogFactory implementation were + * loaded by a child classloader (e.g. a web app classloader). If use of + * a custom LogFactory subclass is desired, ensuring that the + * custom subclass is loaded by the same classloader as LogFactory + * will prevent problems. In normal deployments, the standard implementations + * of LogFactory found in package org.apache.commons.logging.impl + * will be loaded by the same classloader that loads LogFactory + * itself, so use of the standard LogFactory implementations + * should not pose problems. * * @author Brian Stansberry */ --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org