Interface JobSchedulerClock

All Known Implementing Classes:
JobSchedulerSystemClock

public interface JobSchedulerClock
A clock that provides access to the current DateTime.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.joda.time.DateTime
    now(org.joda.time.DateTimeZone zone)
    Returns the current time for the give time zone.
    org.joda.time.DateTime
    Returns the current UTC time.
    void
    sleep(long duration, TimeUnit unit)
    Causes the current execution thread to sleep for the given duration.
    void
    sleepUninterruptibly(long duration, TimeUnit unit)
    Causes the current execution thread to sleep uninterruptibly for the given duration.
  • Method Details

    • nowUTC

      org.joda.time.DateTime nowUTC()
      Returns the current UTC time.
      Returns:
      current time
    • now

      org.joda.time.DateTime now(org.joda.time.DateTimeZone zone)
      Returns the current time for the give time zone.
      Returns:
      current time
    • sleep

      void sleep(long duration, TimeUnit unit) throws InterruptedException
      Causes the current execution thread to sleep for the given duration.
      Parameters:
      duration - duration value
      unit - duration unit
      Throws:
      InterruptedException
    • sleepUninterruptibly

      void sleepUninterruptibly(long duration, TimeUnit unit)
      Causes the current execution thread to sleep uninterruptibly for the given duration.
      Parameters:
      duration - duration value
      unit - duration unit