当前位置: 首页>>代码示例>>Java>>正文


Java LogFactory.release方法代码示例

本文整理汇总了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();
	}
}
 
开发者ID:GIScience,项目名称:openrouteservice,代码行数:26,代码来源:ORSInitContextListener.java

示例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();

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:38,代码来源:ActionServlet.java


注:本文中的org.apache.commons.logging.LogFactory.release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。