Class SystemExiter


  • public class SystemExiter
    extends Object
    Used to override System.exit() calls. For our tests we don't want System.exit to have any effect.
    Version:
    $Revision: 1.1 $
    Author:
    Kabir Khan
    • Constructor Detail

      • SystemExiter

        public SystemExiter()
    • Method Detail

      • abort

        public static void abort​(int status)
        Equivalent to logAndExit(ExitLogger, int) but with an ExitLogger that writes an "Aborting..." message to the log. So this method should only be used for unexpected exits.
        Parameters:
        status - the status code to provide to the exiter
      • safeAbort

        public static void safeAbort()
      • logBeforeExit

        public static void logBeforeExit​(SystemExiter.ExitLogger logger)
        Invokes the exit logger if and only if no ExitLogger was previously invoked.
        Parameters:
        logger - the logger. Cannot be null