commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging LogFactory.java
Date Wed, 18 Dec 2002 07:20:50 GMT
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:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message