Interface Scheduler


public interface Scheduler
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(Runnable runnable)
    Executes the given runnable asynchronously.
    schedule(Runnable runnable, long delay, TimeUnit timeUnit)
    Schedules the given runnable to be executed asynchronously after the given delay.
    scheduleRepeating(Runnable runnable, long delay, long period, TimeUnit timeUnit)
    Schedules the given runnable to be executed asynchronously after a delay and then repeatedly with a period.
    void
    Shuts down the scheduler and awaits task termination.
  • Method Details

    • execute

      Task execute(Runnable runnable)
      Executes the given runnable asynchronously.
      Parameters:
      runnable - runnable to execute
    • schedule

      Task schedule(Runnable runnable, long delay, TimeUnit timeUnit)
      Schedules the given runnable to be executed asynchronously after the given delay.
      Parameters:
      runnable - runnable to execute
      delay - delay before execution
      timeUnit - time unit of the delay
    • scheduleRepeating

      Task scheduleRepeating(Runnable runnable, long delay, long period, TimeUnit timeUnit)
      Schedules the given runnable to be executed asynchronously after a delay and then repeatedly with a period.
      Parameters:
      runnable - runnable to execute
      delay - delay before execution
      period - period between executions
      timeUnit - time unit of the delay and period
    • shutdown

      void shutdown()
      Shuts down the scheduler and awaits task termination.