Class StaticDeadline
- java.lang.Object
-
- org.hibernate.search.engine.common.timing.spi.StaticDeadline
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longcheckRemainingTimeMillis()voidforceTimeout(Exception cause)SearchTimeoutExceptionforceTimeoutAndCreateException(Exception cause)static DeadlineofMilliseconds(long milliseconds)
-
-
-
Method Detail
-
ofMilliseconds
public static Deadline ofMilliseconds(long milliseconds)
- Parameters:
milliseconds- The number of milliseconds until the deadline.- Returns:
- An immutable
Deadlinewhich 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:
checkRemainingTimeMillisin interfaceDeadline- Returns:
- The remaining time to the deadline in milliseconds.
-
forceTimeout
public void forceTimeout(Exception cause)
- Specified by:
forceTimeoutin interfaceDeadline- Parameters:
cause- The cause of the timeout, ornull.
-
forceTimeoutAndCreateException
public SearchTimeoutException forceTimeoutAndCreateException(Exception cause)
- Specified by:
forceTimeoutAndCreateExceptionin interfaceDeadline- Parameters:
cause- The cause of the timeout, ornull.- Returns:
- An exception to be thrown on timeout.
-
-