Class StaticDeadline
java.lang.Object
org.hibernate.search.engine.common.timing.spi.StaticDeadline
- All Implemented Interfaces:
Deadline
-
Method Summary
Modifier and TypeMethodDescriptionlong
void
forceTimeout
(Exception cause) static Deadline
ofMilliseconds
(long milliseconds)
-
Method Details
-
ofMilliseconds
- Parameters:
milliseconds
- The number of milliseconds until the deadline.- Returns:
- An immutable
Deadline
which does not track the passing time.checkRemainingTimeMillis()
will always return the same value and will never throw an exception.
-
checkRemainingTimeMillis
public long checkRemainingTimeMillis()- Specified by:
checkRemainingTimeMillis
in interfaceDeadline
- Returns:
- The remaining time to the deadline in milliseconds.
-
forceTimeout
- Specified by:
forceTimeout
in interfaceDeadline
- Parameters:
cause
- The cause of the timeout, ornull
.
-
forceTimeoutAndCreateException
- Specified by:
forceTimeoutAndCreateException
in interfaceDeadline
- Parameters:
cause
- The cause of the timeout, ornull
.- Returns:
- An exception to be thrown on timeout.
-