Package org.graylog.scheduler.clock
Interface JobSchedulerClock
- All Known Implementing Classes:
JobSchedulerSystemClock
public interface JobSchedulerClock
A clock that provides access to the current
DateTime
.-
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.DateTime
now
(org.joda.time.DateTimeZone zone) Returns the current time for the give time zone.org.joda.time.DateTime
nowUTC()
Returns the current UTC time.void
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
Causes the current execution thread to sleep for the given duration.- Parameters:
duration
- duration valueunit
- duration unit- Throws:
InterruptedException
-
sleepUninterruptibly
Causes the current execution thread to sleep uninterruptibly for the given duration.- Parameters:
duration
- duration valueunit
- duration unit
-