Class SystemSleeper

  • All Implemented Interfaces:
    Sleeper, java.io.Serializable

    @ThreadSafe
    public final class SystemSleeper
    extends java.lang.Object
    implements Sleeper, java.io.Serializable
    Implementation of Sleeper for production use.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SystemSleeper()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void sleep​(org.joda.time.ReadableDuration duration)
      Puts the current thread to sleep.
      void sleepUninterruptibly​(org.joda.time.ReadableDuration duration)
      Puts the current thread to sleep, ignoring interrupts.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SystemSleeper

        @Inject
        public SystemSleeper()
    • Method Detail

      • sleep

        public void sleep​(org.joda.time.ReadableDuration duration)
                   throws java.lang.InterruptedException
        Description copied from interface: Sleeper
        Puts the current thread to sleep.
        Specified by:
        sleep in interface Sleeper
        Throws:
        java.lang.InterruptedException - if this thread was interrupted
      • sleepUninterruptibly

        public void sleepUninterruptibly​(org.joda.time.ReadableDuration duration)
        Description copied from interface: Sleeper
        Puts the current thread to sleep, ignoring interrupts.

        If InterruptedException was caught, then Thread.currentThread().interrupt() will be called at the end of the duration.

        Specified by:
        sleepUninterruptibly in interface Sleeper
        See Also:
        Uninterruptibles.sleepUninterruptibly(java.time.Duration)