Class UncaughtExceptionHandlers


  • @Deprecated(since="2022-12-01")
    public final class UncaughtExceptionHandlers
    extends java.lang.Object
    Deprecated.
    The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
    Factories for Thread.UncaughtExceptionHandler instances.
    Since:
    8.0
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.Thread.UncaughtExceptionHandler systemExit()
      Deprecated.
      Returns an exception handler that exits the system.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • systemExit

        public static java.lang.Thread.UncaughtExceptionHandler systemExit()
        Deprecated.
        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());
           ...
         

        The returned handler logs any exception at severity SEVERE and then shuts down the process with an exit status of 1, indicating abnormal termination.