use of com.google.common.util.concurrent.SimpleTimeLimiter in project scheduling by ow2-proactive.
the class ProgressFileReader method closeWatchService.
private void closeWatchService() throws Exception {
TimeLimiter timeLimiter = new SimpleTimeLimiter();
timeLimiter.callWithTimeout(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
watchService.close();
watchServiceThread.join();
return true;
}
}, 2, TimeUnit.SECONDS, true);
}
Aggregations