本文整理了Java中org.apache.commons.logging.LogFactory.releaseAll()
方法的一些代码示例,展示了LogFactory.releaseAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LogFactory.releaseAll()
方法的具体详情如下:
包路径:org.apache.commons.logging.LogFactory
类名称:LogFactory
方法名:releaseAll
[英]Release any internal references to previously created LogFactoryinstances, after calling the instance method release()
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.
[中]在对以前创建的LogFactoryinstances调用实例方法release()
之后,释放对它们的任何内部引用。这在servlet容器之类的环境中很有用,servlet容器通过丢弃类加载器来实现应用程序重新加载。挂起对该类装入器中对象的引用将阻止垃圾收集。
代码示例来源:origin: jenkinsci/jenkins
private void _cleanUpReleaseAllLoggers(List<Throwable> errors) {
LOGGER.log(Level.FINE, "Releasing all loggers");
try {
LogFactory.releaseAll();
} catch (OutOfMemoryError e) {
// we should just propagate this, no point trying to log
throw e;
} catch (LinkageError e) {
LOGGER.log(SEVERE, "Failed to release all loggers", e);
// safe to ignore and continue for this one
} catch (Throwable e) {
LOGGER.log(SEVERE, "Failed to release all loggers", e);
// save for later
errors.add(e);
}
}
代码示例来源:origin: org.seasar.util/s2util
@Override
public void releaseAll() {
LogFactory.releaseAll();
}
代码示例来源:origin: com.github.ns2j/nos2jdbc-util
/**
* リソースを開放します。
*/
public synchronized static void dispose() {
LogFactory.releaseAll();
loggers.clear();
initialized = false;
}
代码示例来源:origin: org.seasar.container/s2-framework
/**
* リソースを開放します。
*/
public synchronized static void dispose() {
LogFactory.releaseAll();
loggers.clear();
initialized = false;
}
代码示例来源:origin: se.vgregion.HsaTools/HsaTools-Mocks
/**
* Resets the system property LogFactory looks at to find the correct LogFactory to return when a factory is requested and releases all instances.
*/
public static void resetInstance() {
System.clearProperty("org.apache.commons.logging.LogFactory");
LogFactory.releaseAll();
}
代码示例来源:origin: org.apache.geronimo.genesis.plugins/plugin-support
public synchronized static void init() {
if (!initialized) {
LogFactory.releaseAll();
// Setup the delegating log
System.setProperty("org.apache.commons.logging.Log", "org.apache.geronimo.genesis.logging.DelegatingLog");
// Make sure that Geronimo bootstrap logging does not clobber our logging
System.setProperty("geronimo.bootstrap.logging.enabled", "false");
Log log = LogFactory.getLog(Logging.class);
log.debug("Initialized");
initialized = true;
}
}
代码示例来源:origin: org.codehaus.mojo/plugin-support
public synchronized static void init() {
if (!initialized) {
LogFactory.releaseAll();
//
// FIXME: Need to move this back to the car-maven-plugin, need to revisit
// all this mojo logging to JCL/Log4j muck...
//
// Setup the delegating log
System.setProperty("org.apache.commons.logging.Log", "org.codehaus.mojo.pluginsupport.logging.DelegatingLog");
// Make sure that Geronimo bootstrap logging does not clobber our logging
System.setProperty("geronimo.bootstrap.logging.enabled", "false");
Log log = LogFactory.getLog(Logging.class);
log.debug("Initialized");
initialized = true;
}
}
代码示例来源:origin: org.apache.geronimo.genesis.plugins/plugin-support
public synchronized static void reset() {
if (initialized) {
Log log = LogFactory.getLog(Logging.class);
log.debug("Resetting");
LogFactory.releaseAll();
// Restore a reasonable default log impl
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
// Make SimpleLog look more like Maven logs
System.setProperty("org.apache.commons.logging.simplelog.showShortLogname", "false");
// Restore default Geornimo bootstrap behavior
System.getProperties().remove("geronimo.bootstrap.logging.enabled");
initialized = false;
}
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
private void _cleanUpReleaseAllLoggers(List<Throwable> errors) {
LOGGER.log(Level.FINE, "Releasing all loggers");
try {
LogFactory.releaseAll();
} catch (OutOfMemoryError e) {
// we should just propagate this, no point trying to log
throw e;
} catch (LinkageError e) {
LOGGER.log(SEVERE, "Failed to release all loggers", e);
// safe to ignore and continue for this one
} catch (Throwable e) {
LOGGER.log(SEVERE, "Failed to release all loggers", e);
// save for later
errors.add(e);
}
}
代码示例来源:origin: org.codehaus.mojo/plugin-support
public synchronized static void reset() {
if (initialized) {
Log log = LogFactory.getLog(Logging.class);
log.debug("Resetting");
LogFactory.releaseAll();
// Restore a reasonable default log impl
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
// Make SimpleLog look more like Maven logs
System.setProperty("org.apache.commons.logging.simplelog.showShortLogname", "false");
// Restore default Geornimo bootstrap behavior
System.getProperties().remove("geronimo.bootstrap.logging.enabled");
initialized = false;
}
}
}
代码示例来源:origin: se.vgregion.HsaTools/HsaTools-Mocks
/**
* Creates an instance of the LogFactoryMock and sets the system property LogFactory looks at to find the correct LogFactory to return when a factory is requested and releases all instances to make
* sure that a LogFactoryMock is returned.
*
* @return An instance of LogFactoryMock.
*/
public static LogFactoryMock createInstance() {
LogFactoryMock.resetInstance();
System.setProperty("org.apache.commons.logging.LogFactory", "se.vgregion.kivtools.mocks.LogFactoryMock");
LogFactory.releaseAll();
return (LogFactoryMock) LogFactory.getFactory();
}
代码示例来源:origin: org.rhq/rhq-core-plugin-container
/**
* Does things that help the garbage collector clean up the memory.
* Only call this after the plugin container has been shutdown.
*/
private void cleanMemory() {
Introspector.flushCaches();
LogFactory.releaseAll();
// for why we need to do this, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821
try {
Configuration.setConfiguration(null);
} catch (Throwable t) {
}
System.gc();
}
代码示例来源:origin: com.opensymphony/webwork
/**
* Destroys the XWork component manager because the server is shutting down.
*
* @param event the servlet context event.
*/
public void contextDestroyed(ServletContextEvent event) {
ServletContext application = event.getServletContext();
ComponentManager container = (ComponentManager) application.getAttribute(ComponentManager.COMPONENT_MANAGER_KEY);
if (container != null) {
container.dispose();
}
// do some cleanup
// If the JavaBeans Introspector has been used to analyze application classes,
// the Introspector cache will hold a hard reference to those classes.
// Consequently, those classes and the web app class loader will not be
// garbage collected on web app shutdown!
Introspector.flushCaches(); // WW-758
LogFactory.releaseAll();
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
LogFactory.releaseAll();
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
LogFactory.releaseAll();
代码示例来源:origin: ombre42/jrobotremoteserver
/**
* Configures logging systems used by <tt>RemoteServer</tt> and its
* dependencies. Specifically,
* <ul>
* <li>Configure Log4J to log to the console</li>
* <li>Set Log4J's log level to INFO</li>
* <li>Redirect the Jetty's logging to Log4J</li>
* <li>Set Jakarta Commons Logging to log to Log4J</li>
* </ul>
* This is convenient if you do not want to configure the logging yourself.
* This will only affect future instances of
* {@link org.eclipse.jetty.util.log.Logger} and
* {@link org.apache.commons.logging.Log}, so this should be called as early
* as possible.
*/
public static void configureLogging() {
Logger root = Logger.getRootLogger();
root.removeAllAppenders();
BasicConfigurator.configure();
root.setLevel(Level.INFO);
org.eclipse.jetty.util.log.Log.setLog(new Jetty2Log4J());
LogFactory.releaseAll();
LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.Log4JLogger");
log = LogFactory.getLog(RemoteServer.class);
}
代码示例来源:origin: deegree/deegree3
LogFactory.releaseAll();
LogManager.shutdown();
代码示例来源:origin: org.eclipse.hudson/hudson-core
pluginCenter.shutdown();
LogFactory.releaseAll();
代码示例来源:origin: org.seasar.mayaa/mayaa
public void destroy() {
ReferenceCache.finishThreads();
ProviderUtil.getEngine().destroy();
SerializeThreadManager.destroy();
JspProcessor.clear();
LogFactory.releaseAll();
}
代码示例来源:origin: org.seasar.mayaa/mayaa
public void destroy() {
ReferenceCache.finishThreads();
AutoPageBuilder.INSTANCE.destroy();
ProviderUtil.getEngine().destroy();
SerializeThreadManager.destroy();
JspProcessor.clear();
ObjectUtil.clearCaches();
LogFactory.releaseAll();
}
内容来源于网络,如有侵权,请联系作者删除!