Package org.apache.solr.util
Class TimeOut
- java.lang.Object
- 
- org.apache.solr.util.TimeOut
 
- 
 public class TimeOut extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description TimeOut(long interval, TimeUnit unit, TimeSource timeSource)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasTimedOut()voidsleep(long ms)longtimeElapsed(TimeUnit unit)longtimeLeft(TimeUnit unit)StringtoString()voidwaitFor(String messageOnTimeOut, Supplier<Boolean> supplier)Wait until the givenSupplierreturns true or the time out expires which ever happens first
 
- 
- 
- 
Constructor Detail- 
TimeOutpublic TimeOut(long interval, TimeUnit unit, TimeSource timeSource)
 
- 
 - 
Method Detail- 
hasTimedOutpublic boolean hasTimedOut() 
 - 
sleeppublic void sleep(long ms) throws InterruptedException- Throws:
- InterruptedException
 
 - 
timeLeftpublic long timeLeft(TimeUnit unit) 
 - 
timeElapsedpublic long timeElapsed(TimeUnit unit) 
 - 
waitForpublic void waitFor(String messageOnTimeOut, Supplier<Boolean> supplier) throws InterruptedException, TimeoutException Wait until the givenSupplierreturns true or the time out expires which ever happens first- Parameters:
- messageOnTimeOut- the exception message to be used in case a TimeoutException is thrown
- supplier- a- Supplierthat returns a- Booleanvalue
- Throws:
- InterruptedException- if any thread has interrupted the current thread
- TimeoutException- if the timeout expires
 
 
- 
 
-