/** * Forcibly terminates the currently running Java virtual machine. * @param status status code * @throws HaltException if {@link Runtime#halt(int)} is disabled. */ public static void halt(int status) throws HaltException { halt(status, HALT_EXCEPTION_MESSAGE); }
/** * Forcibly terminates the currently running Java virtual machine. * * @param status exit code to use if the exception is not a HaltException. * @param t throwable which triggered the termination. If this exception * is a {@link HaltException} its status overrides that passed in. * @throws HaltException if {@link System#exit(int)} is disabled. */ public static void halt(int status, Throwable t) throws HaltException { if (t instanceof HaltException) { halt((HaltException) t); } else { halt(new HaltException(status, t)); } }
/** * Forcibly terminates the currently running Java virtual machine. * @param status status code * @param message message * @throws HaltException if {@link Runtime#halt(int)} is disabled. */ public static void halt(int status, String message) throws HaltException { halt(new HaltException(status, message)); }
/** * Main entry point. * @param argv args list */ public static void main(String[] argv) { try { ExitUtil.terminate(exec(new Configuration(), argv)); } catch (ExitUtil.ExitException e) { LOG.error(e.toString()); System.exit(e.status); } catch (Exception e) { LOG.error(e.toString(), e); ExitUtil.halt(-1, e); } }
@Override public void uncaughtException(Thread t, Throwable e) { LOG.info("UncaughtExceptionHandler invoked"); if(ShutdownHookManager.isShutdownInProgress()) { LOG.warn("Thread {} threw a Throwable, but we are shutting down, so ignoring this", t, e); } else if(e instanceof Error) { try { LOG.error("Thread {} threw an Error. Shutting down now...", t, e); } catch (Throwable err) { //We don't want to not exit because of an issue with logging } if(e instanceof OutOfMemoryError) { //After catching an OOM java says it is undefined behavior, so don't //even try to clean up or we can get stuck on shutdown. try { System.err.println("Halting due to Out Of Memory Error..."); e.printStackTrace(); } catch (Throwable err) { //Again we done want to exit because of logging issues. } ExitUtil.halt(-1); } else { ExitUtil.terminate(-1); } } else { LOG.error("Thread {} threw an Exception. Shutting down now...", t, e); ExitUtil.terminate(-1); } } }
ExitUtil.halt(LauncherExitCodes.EXIT_INTERRUPTED, message);
@Override public void execute(SliderAppMaster appMaster, QueueAccess queueService, AppState appState) throws Exception { ExitUtil.halt(status, text); } }
/** * Forcibly terminates the currently running Java virtual machine. * @param status * @throws ExitException */ public static void halt(int status) throws HaltException { halt(status, "HaltException"); } }
/** * Forcibly terminates the currently running Java virtual machine. * @param status * @throws ExitException */ public static void halt(int status) throws HaltException { halt(status, "HaltException"); } }
/** * Forcibly terminates the currently running Java virtual machine. * @param status * @throws ExitException */ public static void halt(int status) throws HaltException { halt(status, "HaltException"); } }
/** * Forcibly terminates the currently running Java virtual machine. * @param status * @throws ExitException */ public static void halt(int status) throws HaltException { halt(status, "HaltException"); } }
@Override public void execute(SliderAppMaster appMaster, QueueAccess queueService, AppState appState) throws Exception { ExitUtil.halt(status, text); } }
@Override public void run() { try { ExitUtil.halt(status, text); //this should never be reached } catch (ExitUtil.HaltException e) { log.info("Halt failed"); } } }
@Override public void run() { try { ExitUtil.halt(status, text); //this should never be reached } catch (ExitUtil.HaltException e) { log.info("Halt failed"); } } }
/** * Forcibly terminates the currently running Java virtual machine. * * @param status * @param t * @throws ExitException */ public static void halt(int status, Throwable t) throws HaltException { halt(status, StringUtils.stringifyException(t)); }
/** * Forcibly terminates the currently running Java virtual machine. * * @param status * @param t * @throws ExitException */ public static void halt(int status, Throwable t) throws HaltException { halt(status, StringUtils.stringifyException(t)); }
/** * Forcibly terminates the currently running Java virtual machine. * * @param status * @param t * @throws ExitException */ public static void halt(int status, Throwable t) throws HaltException { halt(status, StringUtils.stringifyException(t)); }
/** * Forcibly terminates the currently running Java virtual machine. * * @param status * @param t * @throws ExitException */ public static void halt(int status, Throwable t) throws HaltException { halt(status, StringUtils.stringifyException(t)); }
/** * Main entry point. * @param argv args list */ public static void main(String[] argv) { try { ExitUtil.terminate(exec(new Configuration(), argv)); } catch (ExitUtil.ExitException e) { LOG.error(e.toString()); System.exit(e.status); } catch (Exception e) { LOG.error(e.toString(), e); ExitUtil.halt(-1, e); } }
@Override public void uncaughtException(Thread t, Throwable e) { if(ShutdownHookManager.get().isShutdownInProgress()) { LOG.error("Thread " + t + " threw an Throwable, but we are shutting " + "down, so ignoring this", e); } else if(e instanceof Error) { try { LOG.fatal("Thread " + t + " threw an Error. Shutting down now...", e); } catch (Throwable err) { //We don't want to not exit because of an issue with logging } if(e instanceof OutOfMemoryError) { //After catching an OOM java says it is undefined behavior, so don't //even try to clean up or we can get stuck on shutdown. try { System.err.println("Halting due to Out Of Memory Error..."); } catch (Throwable err) { //Again we done want to exit because of logging issues. } ExitUtil.halt(-1); } else { ExitUtil.terminate(-1); } } else { LOG.error("Thread " + t + " threw an Exception.", e); } } }