craigmcc 2002/12/17 23:20:50
Modified: logging/src/java/org/apache/commons/logging LogFactory.java
Log:
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.
Revision Changes Path
1.19 +25 -4
jakarta-commons/logging/src/java/org/apache/commons/logging/LogFactory.java
Index: LogFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/LogFactory.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- LogFactory.java 13 Dec 2002 16:55:39 -0000 1.18
+++ LogFactory.java 18 Dec 2002 07:20:50 -0000 1.19
@@ -418,6 +418,27 @@
/**
* 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}
* instances, after calling the instance method <code>release()</code> on
* each of them. This is useful environments like servlet containers,
* which implement application reloading by throwing away a ClassLoader.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>