1
0

Correct caching behavior... I broke it a while back, but

I've learned much since then...


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138907 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Richard A. Sitze
2002-08-12 21:01:07 +00:00
parent 1da90cf28c
commit 5c1867cae3

View File

@@ -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.10 2002/08/09 16:18:36 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.11 2002/08/12 21:01:07 rsitze Exp $
* $Revision: 1.10 $ * $Revision: 1.11 $
* $Date: 2002/08/09 16:18:36 $ * $Date: 2002/08/12 21:01:07 $
* *
* ==================================================================== * ====================================================================
* *
@@ -85,7 +85,7 @@ import java.lang.SecurityException;
* *
* @author Craig R. McClanahan * @author Craig R. McClanahan
* @author Costin Manolache * @author Costin Manolache
* @version $Revision: 1.10 $ $Date: 2002/08/09 16:18:36 $ * @version $Revision: 1.11 $ $Date: 2002/08/12 21:01:07 $
*/ */
public abstract class LogFactory { public abstract class LogFactory {
@@ -347,6 +347,13 @@ public abstract class LogFactory {
factory = newFactory(FACTORY_DEFAULT, LogFactory.class.getClassLoader()); factory = newFactory(FACTORY_DEFAULT, LogFactory.class.getClassLoader());
} }
if (factory != null) {
/**
* Always cache using context class loader..
*/
cacheFactory(contextClassLoader, factory);
}
if( props!=null ) { if( props!=null ) {
Enumeration names = props.propertyNames(); Enumeration names = props.propertyNames();
while (names.hasMoreElements()) { while (names.hasMoreElements()) {
@@ -541,9 +548,6 @@ public abstract class LogFactory {
LogFactory factory = (LogFactory)clazz.newInstance(); LogFactory factory = (LogFactory)clazz.newInstance();
// Cache using correct classLoader
cacheFactory(classLoader, factory);
return factory; return factory;
} catch (Exception e) { } catch (Exception e) {
throw new LogConfigurationException(e); throw new LogConfigurationException(e);