Class SimpleTaskScheduler

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class SimpleTaskScheduler
    extends java.lang.Object
    implements java.io.Closeable
    Scheduler for simple and short tasks
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the resources at best effort.
      void schedule​(java.lang.String name, java.time.Duration delay, java.lang.Runnable task)  
      void schedulePeriodic​(java.lang.String name, java.time.Duration interval, java.lang.Runnable task)  
      boolean unschedule​(java.lang.String name)  
      • Methods inherited from class java.lang.Object

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

      • SimpleTaskScheduler

        public SimpleTaskScheduler()
    • Method Detail

      • schedule

        public void schedule​(java.lang.String name,
                             java.time.Duration delay,
                             java.lang.Runnable task)
      • schedulePeriodic

        public void schedulePeriodic​(java.lang.String name,
                                     java.time.Duration interval,
                                     java.lang.Runnable task)
      • unschedule

        public boolean unschedule​(java.lang.String name)
      • close

        public void close()
        Close the resources at best effort. The action is uninterruptible, but the interruption status is restore.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable