/** * Workaround for bug in Java1.2; in theory this method is not needed. * See LogFactory.isDiagnosticsEnabled. */ protected static boolean isDiagnosticsEnabled() { return LogFactory.isDiagnosticsEnabled(); }
/** * Workaround for bug in Java1.2; in theory this method is not needed. * See LogFactory.isDiagnosticsEnabled. */ protected static boolean isDiagnosticsEnabled() { return LogFactory.isDiagnosticsEnabled(); }
public Object run() { try { if (loader != null) { return loader.getResources(name); } else { return ClassLoader.getSystemResources(name); } } catch (IOException e) { if (isDiagnosticsEnabled()) { logDiagnostic("Exception while trying to find configuration file " + name + ":" + e.getMessage()); } return null; } catch (NoSuchMethodError e) { // we must be running on a 1.1 JVM which doesn't support // ClassLoader.getSystemResources; just return null in // this case. return null; } } };
if (isDiagnosticsEnabled()) { logDiagnostic("Unable to read URL " + url); } catch (IOException e) { if (isDiagnosticsEnabled()) { logDiagnostic("Unable to close stream for URL " + url);
public Object run() { try { InputStream stream = url.openStream(); if (stream != null) { Properties props = new Properties(); props.load(stream); stream.close(); return props; } } catch(IOException e) { if (isDiagnosticsEnabled()) { logDiagnostic("Unable to read URL " + url); } } return null; } };
public Object run() { try { if (loader != null) { return loader.getResources(name); } else { return ClassLoader.getSystemResources(name); } } catch(IOException e) { if (isDiagnosticsEnabled()) { logDiagnostic( "Exception while trying to find configuration file " + name + ":" + e.getMessage()); } return null; } catch(NoSuchMethodError e) { // we must be running on a 1.1 JVM which doesn't support // ClassLoader.getSystemResources; just return null in // this case. return null; } } };
return clazz.getClassLoader(); } catch (SecurityException ex) { if (isDiagnosticsEnabled()) { logDiagnostic("Unable to get classloader for class '" + clazz + "' due to security restrictions - " + ex.getMessage());
/** * 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 in environments like servlet containers, * which implement application reloading by throwing away a ClassLoader. * Dangling references to objects in that class loader would prevent * garbage collection. */ public static void releaseAll() { if (isDiagnosticsEnabled()) { logDiagnostic("Releasing factory for all classloaders."); } // factories is not final and could be replaced in this block. final Hashtable factories = LogFactory.factories; synchronized (factories) { final Enumeration elements = factories.elements(); while (elements.hasMoreElements()) { LogFactory element = (LogFactory) elements.nextElement(); element.release(); } factories.clear(); if (nullClassLoaderFactory != null) { nullClassLoaderFactory.release(); nullClassLoaderFactory = null; } } }
return clazz.getClassLoader(); } catch(SecurityException ex) { if (isDiagnosticsEnabled()) { logDiagnostic( "Unable to get classloader for class '" + clazz
if (!isDiagnosticsEnabled()) { return;
if (isDiagnosticsEnabled()) { logDiagnostic("[LOOKUP] Properties file found at '" + url + "'" + " with priority " + priority); if (isDiagnosticsEnabled()) { logDiagnostic("[LOOKUP] Properties file at '" + url + "'" + " with priority " + newPriority + priority = newPriority; } else { if (isDiagnosticsEnabled()) { logDiagnostic("[LOOKUP] Properties file at '" + url + "'" + " with priority " + newPriority + if (isDiagnosticsEnabled()) { logDiagnostic("SecurityException thrown while trying to find/read config files."); if (isDiagnosticsEnabled()) { if (props == null) { logDiagnostic("[LOOKUP] No properties file of name '" + fileName + "' found.");
/** * 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 in environments like servlet containers, * which implement application reloading by throwing away a ClassLoader. * Dangling references to objects in that class loader would prevent * garbage collection. */ public static void releaseAll() { if (isDiagnosticsEnabled()) { logDiagnostic("Releasing factory for all classloaders."); } synchronized (factories) { Enumeration elements = factories.elements(); while (elements.hasMoreElements()) { LogFactory element = (LogFactory) elements.nextElement(); element.release(); } factories.clear(); if (nullClassLoaderFactory != null) { nullClassLoaderFactory.release(); nullClassLoaderFactory = null; } } }
/** * 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) { if (isDiagnosticsEnabled()) { logDiagnostic("Releasing factory for classloader " + objectId(classLoader)); } // factories is not final and could be replaced in this block. final Hashtable factories = LogFactory.factories; synchronized (factories) { if (classLoader == null) { if (nullClassLoaderFactory != null) { nullClassLoaderFactory.release(); nullClassLoaderFactory = null; } } else { final LogFactory factory = (LogFactory) factories.get(classLoader); if (factory != null) { factory.release(); factories.remove(classLoader); } } } }
if (!isDiagnosticsEnabled()) { return;
if (isDiagnosticsEnabled()) { logDiagnostic("An error occurred while loading the factory class:" + ex.getMessage()); if (isDiagnosticsEnabled()) { logDiagnostic("Created object " + objectId(result) + " to manage classloader " + objectId(contextClassLoader));
/** * 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) { if (isDiagnosticsEnabled()) { logDiagnostic("Releasing factory for classloader " + objectId(classLoader)); } synchronized (factories) { if (classLoader == null) { if (nullClassLoaderFactory != null) { nullClassLoaderFactory.release(); nullClassLoaderFactory = null; } } else { LogFactory factory = (LogFactory) factories.get(classLoader); if (factory != null) { factory.release(); factories.remove(classLoader); } } } }
if (!isDiagnosticsEnabled()) { return;
if (!isDiagnosticsEnabled()) { return;