Return-Path: Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 45173 invoked by uid 1219); 10 Dec 2000 21:21:16 -0000 Date: 10 Dec 2000 21:21:16 -0000 Message-ID: <20001210212116.45172.qmail@locus.apache.org> From: prussell@locus.apache.org To: xml-cocoon-cvs@apache.org Subject: cvs commit: xml-cocoon/src/org/apache/cocoon/util ComponentPool.java prussell 00/12/10 13:21:16 Modified: src/org/apache/cocoon/util Tag: xml-cocoon2 ComponentPool.java Log: Added logging to ComponentPool to make it easier to track down components which aren't being returned. Revision Changes Path No revision No revision 1.1.2.2 +17 -1 xml-cocoon/src/org/apache/cocoon/util/Attic/ComponentPool.java Index: ComponentPool.java =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/util/Attic/ComponentPool.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- ComponentPool.java 2000/10/13 04:05:40 1.1.2.1 +++ ComponentPool.java 2000/12/10 21:21:16 1.1.2.2 @@ -13,6 +13,9 @@ import org.apache.avalon.util.pool.ObjectFactory; import org.apache.avalon.util.pool.PoolController; +import org.apache.log.Logger; +import org.apache.log.LogKit; + /** * This is a implementation of Pool for SitemapComponents * that is thread safe. @@ -23,6 +26,8 @@ public final static int DEFAULT_POOL_SIZE = 16; + private Logger log = LogKit.getLoggerFor("cocoon"); + public ComponentPool(final ObjectFactory factory, final PoolController controller) throws Exception { super(factory, controller, DEFAULT_POOL_SIZE/2, DEFAULT_POOL_SIZE); @@ -48,7 +53,13 @@ */ public final Poolable get() throws Exception { synchronized(m_pool) { - return super.get(); + Poolable component = super.get(); + log.debug( + "ComponentPool retrieved " + + component.getClass().getName() + + " (" + component.toString() + ")" + ); + return component; } } @@ -60,6 +71,11 @@ public final void put(final Poolable poolable) { synchronized(m_pool) { super.put(poolable); + log.debug( + "ComponentPool returned " + + poolable.getClass().getName() + + " (" + poolable.toString() + ")" + ); } } }