com.google.common.util.concurrent
Class UncaughtExceptionHandlers

java.lang.Object
  extended by com.google.common.util.concurrent.UncaughtExceptionHandlers

public final class UncaughtExceptionHandlers
extends java.lang.Object

Factories for Thread.UncaughtExceptionHandler instances.

Since:
8.0

Method Summary
static java.lang.Thread.UncaughtExceptionHandler systemExit()
          Returns an exception handler that exits the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

systemExit

public static java.lang.Thread.UncaughtExceptionHandler systemExit()
Returns an exception handler that exits the system. This is particularly useful for the main thread, which may start up other, non-daemon threads, but fail to fully initialize the application successfully.

Example usage:

public static void main(String[] args) {
   Thread.currentThread().setUncaughtExceptionHandler(UncaughtExceptionHandlers.systemExit());
   ...