Class SafeRecurringTask

  • All Implemented Interfaces:
    java.lang.Runnable

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      static SafeRecurringTask wrap​(java.lang.Runnable runnable)
      Wraps a runnable in a safe recurring task.
      • Methods inherited from class java.lang.Object

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

      • run

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

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