Interface Scheduler

All Known Implementing Classes:
Scheduler.SystemScheduler

public interface Scheduler
Clock and timer used by TokenRenewer and LeaseManager. The default system() uses one shared daemon thread; tests inject a fake to control time.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Wall clock + one shared daemon thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    now()
    Returns the current time.
    schedule(Runnable task, Duration delay)
    Runs task once after delay.
    static Scheduler
    Returns the system scheduler (wall clock, shared daemon timer thread).
  • Method Details

    • now

      Instant now()
      Returns the current time.
      Returns:
      now
    • schedule

      Runnable schedule(Runnable task, Duration delay)
      Runs task once after delay.
      Parameters:
      task - task to run
      delay - delay (zero or positive)
      Returns:
      a handle; running it cancels the task
    • system

      static Scheduler system()
      Returns the system scheduler (wall clock, shared daemon timer thread).
      Returns:
      the scheduler