當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。