/* * [Shutdown.java] * * Summary: All the things we do before we start expanding macros. * * Copyright: (c) 2012-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2012-03-30 initial version. */ package com.mindprod.htmlmacros.support; import com.mindprod.htmlmacros.Replacer; import com.mindprod.htmlmacros.macro.Global; import com.mindprod.htmlmacros.macro.Path; import com.mindprod.jdisplayaux.JDisplayMacro; import com.mindprod.stores.ISBNToASIN; import com.mindprod.stores.Stock; import static java.lang.System.*; /** * All the things we do before we start expanding macros. *
* The list of method calls is manually compiled. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2012-03-30 initial version * @since 2012 */ public class Shutdown { /** * true if want extra debug output */ private static final boolean DEBUGGING = false; // we use explicit call the shutdown, instead of shutdown hook, can precisely control // when it is called. /** * only called by ShutdownHook * List of method calls manually generated. * * @see Fireup#fireup() */ public static void shutdown() { out.println( "shutting down macro expansion..." ); if ( DEBUGGING ) { out.println( "Shutting down unclosed files ..." ); } Global.closeStopMonitoring(); if ( DEBUGGING ) { out.println( "Shutting down ISBN->ASIN system..." ); } ISBNToASIN.shutdown(); if ( DEBUGGING ) { out.println( "Shutting down stock system..." ); } Stock.shutdown(); if ( DEBUGGING ) { out.println( "Shutting down already-done tracking..." ); } if ( DEBUGGING ) { out.println( "Shutting down JDisplay..." ); } JDisplayMacro.shutdown(); if ( DEBUGGING ) { out.println( "Shutting down Path..." ); } Path.shutdown(); if ( DEBUGGING ) { out.println( "Shutting down Quotations..." ); } QuoteFlock.shutdown(); if ( DEBUGGING ) { out.println( "Shutting down RSS feeds..." ); } RSSFeedLog.shutdown(); if ( DEBUGGING ) { out.println( "Shutting down Application..." ); } Replacer.shutdown(); } }