Class TimeoutException

  • All Implemented Interfaces:
    java.io.Serializable

    public class TimeoutException
    extends java.lang.InterruptedException
    Thrown by synchronization classes that report timeouts via exceptions. The exception is treated as a form (subclass) of InterruptedException. This both simplifies handling, and conceptually reflects the fact that timed-out operations are artificially interrupted by timers.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      long duration
      The approximate time that the operation lasted before this timeout exception was thrown.
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeoutException​(long time)
      Constructs a TimeoutException with given duration value.
      TimeoutException​(long time, java.lang.String message)
      Constructs a TimeoutException with the specified duration value and detail message.
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • duration

        public final long duration
        The approximate time that the operation lasted before this timeout exception was thrown.
    • Constructor Detail

      • TimeoutException

        public TimeoutException​(long time)
        Constructs a TimeoutException with given duration value.
      • TimeoutException

        public TimeoutException​(long time,
                                java.lang.String message)
        Constructs a TimeoutException with the specified duration value and detail message.