Experimentally add a release(ClassLoader) method that lets, for example,
a webapp clean up references to any LogFactory, and associated Log instances, that are associated with its class loader. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138948 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogFactory.java,v 1.18 2002/12/13 16:55:39 rsitze Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/LogFactory.java,v 1.19 2002/12/18 07:20:50 craigmcc Exp $
|
||||||
* $Revision: 1.18 $
|
* $Revision: 1.19 $
|
||||||
* $Date: 2002/12/13 16:55:39 $
|
* $Date: 2002/12/18 07:20:50 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
@@ -87,7 +87,7 @@ import java.util.Properties;
|
|||||||
* @author Craig R. McClanahan
|
* @author Craig R. McClanahan
|
||||||
* @author Costin Manolache
|
* @author Costin Manolache
|
||||||
* @author Richard A. Sitze
|
* @author Richard A. Sitze
|
||||||
* @version $Revision: 1.18 $ $Date: 2002/12/13 16:55:39 $
|
* @version $Revision: 1.19 $ $Date: 2002/12/18 07:20:50 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class LogFactory {
|
public abstract class LogFactory {
|
||||||
@@ -416,6 +416,27 @@ public abstract class LogFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Release any internal references to previously created {@link LogFactory}
|
||||||
|
* instances that have been associated with the specified class loader
|
||||||
|
* (if any), after calling the instance method <code>release()</code> on
|
||||||
|
* each of them.
|
||||||
|
*
|
||||||
|
* @param classLoader ClassLoader for which to release the LogFactory
|
||||||
|
*/
|
||||||
|
public static void release(ClassLoader classLoader) {
|
||||||
|
|
||||||
|
synchronized (factories) {
|
||||||
|
LogFactory factory = (LogFactory) factories.get(classLoader);
|
||||||
|
if (factory != null) {
|
||||||
|
factory.release();
|
||||||
|
factories.remove(classLoader);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Release any internal references to previously created {@link LogFactory}
|
* Release any internal references to previously created {@link LogFactory}
|
||||||
* instances, after calling the instance method <code>release()</code> on
|
* instances, after calling the instance method <code>release()</code> on
|
||||||
|
|||||||
Reference in New Issue
Block a user