Class ScheduledExecutors


  • public class ScheduledExecutors
    extends Object
    • Constructor Detail

      • ScheduledExecutors

        public ScheduledExecutors()
    • Method Detail

      • scheduleWithFixedDelay

        public static void scheduleWithFixedDelay​(ScheduledExecutorService exec,
                                                  org.joda.time.Duration initialDelay,
                                                  org.joda.time.Duration delay,
                                                  Runnable runnable)
        Run runnable repeatedly with the given delay between calls, after the given initial delay. Exceptions are caught and logged as errors.
      • scheduleWithFixedDelay

        public static void scheduleWithFixedDelay​(ScheduledExecutorService exec,
                                                  org.joda.time.Duration delay,
                                                  Callable<ScheduledExecutors.Signal> callable)
        Run callable repeatedly with the given delay between calls, after the given initial delay, until it returns Signal.STOP. Exceptions are caught and logged as errors.
      • scheduleWithFixedDelay

        public static void scheduleWithFixedDelay​(ScheduledExecutorService exec,
                                                  org.joda.time.Duration initialDelay,
                                                  org.joda.time.Duration delay,
                                                  Callable<ScheduledExecutors.Signal> callable)
        Run callable repeatedly with the given delay between calls, until it returns Signal.STOP. Exceptions are caught and logged as errors.
      • scheduleAtFixedRate

        public static void scheduleAtFixedRate​(ScheduledExecutorService exec,
                                               org.joda.time.Duration initialDelay,
                                               org.joda.time.Duration period,
                                               Runnable runnable)
        Run runnable once every period, after the given initial delay. Exceptions are caught and logged as errors.