Package org.graylog.scheduler.clock
Class JobSchedulerSystemClock
java.lang.Object
org.graylog.scheduler.clock.JobSchedulerSystemClock
- All Implemented Interfaces:
JobSchedulerClock
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current java.time.Instant.Returns the current time for the give time zone.org.joda.time.DateTimenow(org.joda.time.DateTimeZone zone) Returns the current time for the give time zone.org.joda.time.DateTimenowUTC()Returns the current UTC time.voidCauses the current execution thread to sleep for the given duration.voidsleepUninterruptibly(long duration, TimeUnit unit) Causes the current execution thread to sleep uninterruptibly for the given duration.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
JobSchedulerSystemClock
public JobSchedulerSystemClock()
-
-
Method Details
-
nowUTC
public org.joda.time.DateTime nowUTC()Returns the current UTC time.- Specified by:
nowUTCin interfaceJobSchedulerClock- Returns:
- current time
-
instantNow
Returns the current java.time.Instant.- Specified by:
instantNowin interfaceJobSchedulerClock- Returns:
- current time as
Instant
-
now
public org.joda.time.DateTime now(org.joda.time.DateTimeZone zone) Returns the current time for the give time zone.- Specified by:
nowin interfaceJobSchedulerClock- Returns:
- current time
-
now
Returns the current time for the give time zone.- Specified by:
nowin interfaceJobSchedulerClock- Returns:
- current time
-
sleep
Causes the current execution thread to sleep for the given duration.- Specified by:
sleepin interfaceJobSchedulerClock- Parameters:
duration- duration valueunit- duration unit- Throws:
InterruptedException
-
sleepUninterruptibly
Description copied from interface:JobSchedulerClockCauses the current execution thread to sleep uninterruptibly for the given duration.- Specified by:
sleepUninterruptiblyin interfaceJobSchedulerClock- Parameters:
duration- duration valueunit- duration unit
-