Class Runnables

    • Constructor Detail

      • Runnables

        public Runnables()
    • Method Detail

      • assertNoException

        public static void assertNoException​(Runnable runnable)
        Asserts that the given Runnable does not throw exceptions. If the runnable throws exceptions, then it will call the FatalExitExceptionHandler.
        Parameters:
        runnable - to assert for no exceptions
      • withUncaughtExceptionHandler

        public static Runnable withUncaughtExceptionHandler​(Runnable runnable,
                                                            Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
        Guard Runnable with uncaughtException handler, because ScheduledExecutorService does not respect the one assigned to executing Thread instance.
        Parameters:
        runnable - Runnable future to guard.
        uncaughtExceptionHandler - Handler to call in case of uncaught exception.
        Returns:
        Future with handler.