Class SafeRecurringTask

  • All Implemented Interfaces:
    Runnable

    public final class SafeRecurringTask
    extends Object
    implements Runnable
    Wrapper for a recurring task which catches all exceptions to prevent task being suppressed in a ScheduledExecutorService.
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface Runnable
      • wrap

        public static SafeRecurringTask wrap​(Runnable runnable)
        Wraps a runnable in a safe recurring task.
        Parameters:
        runnable - runnable to wrap
        Returns:
        safe recurring task