Package org.apache.hc.core5.util
Class TimeoutValueException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.util.concurrent.TimeoutException
-
- org.apache.hc.core5.util.TimeoutValueException
-
- All Implemented Interfaces:
java.io.Serializable
public class TimeoutValueException extends java.util.concurrent.TimeoutExceptionA specialization ofTimeoutExceptionthat carries aTimeoutdeadline and the actual value.- Since:
- 5.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Timeoutactualprivate Timeoutdeadlineprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description TimeoutValueException(Timeout deadline, Timeout actual)Creates a new exception for the given timeout deadline and actual timeout.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TimeoutValueExceptionfromMilliseconds(long timeoutDeadline, long timeoutActual)Creates a new exception for the given timeout deadline and actual timeout.TimeoutgetActual()Gets how long was the expected timeout in milliseconds.TimeoutgetDeadline()Gets how long we actually waited in milliseconds.private static longmin0(long value)Returns the givenvalueif positive, otherwise returns 0.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
actual
private final Timeout actual
-
deadline
private final Timeout deadline
-
-
Method Detail
-
fromMilliseconds
public static TimeoutValueException fromMilliseconds(long timeoutDeadline, long timeoutActual)
Creates a new exception for the given timeout deadline and actual timeout.- Parameters:
timeoutDeadline- How long was the expected timeout in milliseconds.timeoutActual- How long we actually waited in milliseconds.- Returns:
- a new TimeoutValueException.
-
min0
private static long min0(long value)
Returns the givenvalueif positive, otherwise returns 0.- Parameters:
value- any timeout- Returns:
- the given
valueif positive, otherwise returns 0.
-
getActual
public Timeout getActual()
Gets how long was the expected timeout in milliseconds.- Returns:
- how long was the expected timeout in milliseconds.
-
getDeadline
public Timeout getDeadline()
Gets how long we actually waited in milliseconds.- Returns:
- how long we actually waited in milliseconds.
-
-