/** * Orderly terminates all the plugins. */ public void stop() { for (PluginWrapper p : activePlugins) { p.stop(); p.releaseClassLoader(); } activePlugins.clear(); // Work around a bug in commons-logging. // See http://www.szegedi.org/articles/memleak.html LogFactory.release(uberClassLoader); }
/** * Terminates the plugin. */ public void stop() { Plugin plugin = getPlugin(); if (plugin != null) { try { LOGGER.log(Level.FINE, "Stopping {0}", shortName); plugin.stop(); } catch (Throwable t) { LOGGER.log(WARNING, "Failed to shut down " + shortName, t); } } else { LOGGER.log(Level.FINE, "Could not find Plugin instance to stop for {0}", shortName); } // Work around a bug in commons-logging. // See http://www.szegedi.org/articles/memleak.html LogFactory.release(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 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; } } }
LogFactory.release(tccl);
/** * 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); } } } }
/** * 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)); } 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); } } } }
LogFactory.release(Thread.currentThread().getContextClassLoader());
/** * 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)); } 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); } } } }
LogFactory.release(tccl);
/** * 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() { release(); }
/** * Release the logger. */ private static synchronized void releaseLogger() { if ( log != null ){ logFactory.release(); log = null; logFactory = null; } }
/** * Forces Log to cleanup any cached resources. This is called by the StripesFilter when * it is destroyed, but can be called from user code as well if necessary. */ public static void cleanup() { LogFactory.release(Thread.currentThread().getContextClassLoader()); }
public void destroy() throws Exception { getSpringContext().close(); if (log.isDebugEnabled()) log.debug("Releasing LogFactory"); LogFactory.release(Thread.currentThread().getContextClassLoader()); if (log.isInfoEnabled()) log.debug("Destroying IntactContext"); instance = null; } }
/** * 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() { getFactory().release(); }
/** * Release any internal references to previously created {@link org.apache.commons.logging.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) { getFactory().release(); }
public void destroy() { LogFactory.release(this); clearSoftCache(ObjectInputStream.class, "subclassAudits"); clearSoftCache(ObjectOutputStream.class, "subclassAudits"); clearSoftCache(ObjectStreamClass.class, "localDescs"); clearSoftCache(ObjectStreamClass.class, "reflectors"); ClassLoaderRegistry.remove(this); }
@Override protected void setUp() throws Exception { super.setUp(); LogFactory.getFactory().release(); LogManager.resetConfiguration(); }
@Override protected void tearDown() throws Exception { LogFactory.getFactory().release(); LogManager.resetConfiguration(); super.tearDown(); }