本文整理汇总了Java中org.apache.commons.logging.LogFactory.release方法的典型用法代码示例。如果您正苦于以下问题:Java LogFactory.release方法的具体用法?Java LogFactory.release怎么用?Java LogFactory.release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.logging.LogFactory
的用法示例。
在下文中一共展示了LogFactory.release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contextDestroyed
import org.apache.commons.logging.LogFactory; //导入方法依赖的package包/类
public void contextDestroyed(ServletContextEvent contextEvent) {
try {
LOGGER.info("Start shutting down ORS and releasing resources.");
if (RoutingProfileManagerStatus.isReady())
RoutingProfileManager.getInstance().destroy();
LocationsDataProviderFactory.releaseProviders();
StatisticsProviderFactory.releaseProviders();
LogFactory.release(Thread.currentThread().getContextClassLoader());
try {
System.gc();
System.runFinalization();
System.gc();
System.runFinalization();
} catch(Throwable t) {
LOGGER.error("Failed to perform finalization.");
t.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例2: destroy
import org.apache.commons.logging.LogFactory; //导入方法依赖的package包/类
/**
* <p>Gracefully shut down this controller servlet, releasing any resources
* that were allocated at initialization.</p>
*/
public void destroy() {
if (log.isDebugEnabled()) {
log.debug(internal.getMessage("finalizing"));
}
destroyModules();
destroyInternal();
getServletContext().removeAttribute(Globals.ACTION_SERVLET_KEY);
// Release our LogFactory and Log instances (if any)
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader == null) {
classLoader = ActionServlet.class.getClassLoader();
}
try {
LogFactory.release(classLoader);
} catch (Throwable t) {
; // Servlet container doesn't have the latest version
; // of commons-logging-api.jar installed
// :FIXME: Why is this dependent on the container's version of commons-logging?
// Shouldn't this depend on the version packaged with Struts?
/*
Reason: LogFactory.release(classLoader); was added as
an attempt to investigate the OutOfMemory error reported on Bugzilla #14042.
It was committed for version 1.136 by craigmcc
*/
}
PropertyUtils.clearDescriptors();
}