Class SystemExiter

java.lang.Object
org.jboss.as.server.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 Details

    • SystemExiter

      public SystemExiter()
  • Method Details

    • initialize

      public static void initialize(SystemExiter.Exiter exiter)
    • 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
    • logAndExit

      public static void logAndExit(SystemExiter.ExitLogger logger, int status)
      Parameters:
      logger - logger the logger. Cannot be null
      status - the status code to provide to the exiter