Package google.registry.util
Interface Sleeper
- All Known Implementing Classes:
SystemSleeper
@ThreadSafe
public interface Sleeper
An object which accepts requests to put the current thread to sleep.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
sleep
(org.joda.time.ReadableDuration duration) Puts the current thread to sleep.default void
sleepInterruptibly
(org.joda.time.ReadableDuration duration) Puts the current thread to interruptible sleep.void
sleepUninterruptibly
(org.joda.time.ReadableDuration duration) Puts the current thread to sleep, ignoring interrupts.
-
Method Details
-
sleep
Puts the current thread to sleep.- Throws:
InterruptedException
- if this thread was interrupted
-
sleepUninterruptibly
void sleepUninterruptibly(org.joda.time.ReadableDuration duration) Puts the current thread to sleep, ignoring interrupts.If
InterruptedException
was caught, thenThread.currentThread().interrupt()
will be called at the end of theduration
.- See Also:
-
sleepInterruptibly
default void sleepInterruptibly(org.joda.time.ReadableDuration duration) Puts the current thread to interruptible sleep.This is a convenience method for
sleep(org.joda.time.ReadableDuration)
that properly converts anInterruptedException
to aRuntimeException
.
-