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


Java Handler.close方法代码示例

本文整理汇总了Java中java.util.logging.Handler.close方法的典型用法代码示例。如果您正苦于以下问题:Java Handler.close方法的具体用法?Java Handler.close怎么用?Java Handler.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.logging.Handler的用法示例。


在下文中一共展示了Handler.close方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: close

import java.util.logging.Handler; //导入方法依赖的package包/类
/** Does its best to close provided handler. Can close handlers created by
 * {@link #createDispatchHandler(java.util.logging.Handler, int)} as well.
 */
public static void close(Handler h) {
    if (h == null) {
        return;
    }
    if (h instanceof DispatchingHandler) {
        ((DispatchingHandler)h).doClose();
    } else {
        h.close();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:NbLogging.java

示例2: closeLogHandlers

import java.util.logging.Handler; //导入方法依赖的package包/类
public static void closeLogHandlers(Logger log) {
	if (DEBUG) {
		for (Handler e: log.getHandlers()) {
			e.close();
		}
	}
}
 
开发者ID:LithiumSR,项目名称:gw2_launcher,代码行数:8,代码来源:Operations.java

示例3: disable

import java.util.logging.Handler; //导入方法依赖的package包/类
private void disable() {
    getProxy().getLogger().info("Disabling plugin " + getDescription().getName() + " version " + getDescription().getVersion() + " by " + getDescription().getAuthor());

    try {
        onDisable();
        for (Handler handler : getLogger().getHandlers())
            handler.close();
    } catch (Exception exception) {
        exception.printStackTrace();
    }

    getProxy().getScheduler().cancel(this);
    getExecutorService().shutdownNow();
    getProxy().getLogger().info("Disabled plugin " + getDescription().getName() + " version " + getDescription().getVersion() + " by " + getDescription().getAuthor());
}
 
开发者ID:shawlaf,项目名称:Banmanager,代码行数:16,代码来源:BanmanagerProxy.java

示例4: freeResources

import java.util.logging.Handler; //导入方法依赖的package包/类
/**
 * This function frees the logger's handlers and deletes the temp file
 */
private static void freeResources(){

    configuration.closeAndDeleteFile();
    //Free resources
    for (Handler handle : configuration.getLogger().getHandlers()) {
        handle.close();
    }
}
 
开发者ID:CheckPoint-APIs-Team,项目名称:ShowPolicyPackage,代码行数:12,代码来源:ShowPackageTool.java

示例5: cleanupLogger

import java.util.logging.Handler; //导入方法依赖的package包/类
/**
 * Removed all the handlers of the given {@link Logger} instance.
 *
 * @param logger {@link Logger} to be cleaned up.
 */
private static void cleanupLogger(Logger logger) {
  if (logger != null) {
    Handler[] handlers = logger.getHandlers();
    for (Handler handler : handlers) {
      handler.close();
      logger.removeHandler(handler);
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:15,代码来源:LogWrapper.java

示例6: getLogFile

import java.util.logging.Handler; //导入方法依赖的package包/类
/** Obtiene, en formato XML, el registro acumulado de la ejecución actual.
 * @return Registro acumulado de la ejecución actual
 * @throws IOException Si no hay registro o este no se puede leer */
public static String getLogFile() throws IOException {
	if (!installed || logFile == null) {
		throw new IOException("No esta instalado el manejador de fichero"); //$NON-NLS-1$
	}

	final Handler[] handlers = LOGGER.getHandlers();
	for (final Handler h : handlers) {
		if (h instanceof FileHandler) {
			h.close();
			LOGGER.info("Cerrado el manejador de fichero para permitir que sea procesado"); //$NON-NLS-1$
			LOGGER.removeHandler(h);
		}
	}

	final InputStream is = new FileInputStream(
		new File(
			logFile.replace("%h", Platform.getUserHome())  //$NON-NLS-1$
		)
	);
	final String log = new String(AOUtil.getDataFromInputStream(is));
	is.close();

	LOGGER.addHandler(createFileHandler(logFile));

	return log;
}
 
开发者ID:MiFirma,项目名称:mi-firma-android,代码行数:30,代码来源:LogManager.java

示例7: shutdown

import java.util.logging.Handler; //导入方法依赖的package包/类
private void shutdown(ActionEvent event) {
    this.logger.info("Courier v" + Version.getVersion() + " shutting down!");

    if (this.integration != null) {
        this.integration.stop();
    }

    for (Handler handler : this.logger.getHandlers()) { // Close our logger handler
        handler.close();
    }

    DiscordRPC.DiscordShutdown();

    System.exit(0);
}
 
开发者ID:Dragovorn,项目名称:courier,代码行数:16,代码来源:Courier.java

示例8: close

import java.util.logging.Handler; //导入方法依赖的package包/类
public void close() throws SecurityException {
    for (Handler h : instances) {
        h.close();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:TopLogging.java

示例9: close

import java.util.logging.Handler; //导入方法依赖的package包/类
@Override
public void close() throws SecurityException {
    for (Handler h : Lookup.getDefault().lookupAll(Handler.class)) {
        h.close();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:LogsTooEarlyTest.java


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