Search in sources :

Example 11 with SimpleTimeLimiter

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);
}
Also used : SimpleTimeLimiter(com.google.common.util.concurrent.SimpleTimeLimiter) TimeLimiter(com.google.common.util.concurrent.TimeLimiter) SimpleTimeLimiter(com.google.common.util.concurrent.SimpleTimeLimiter) IOException(java.io.IOException)

Aggregations

SimpleTimeLimiter (com.google.common.util.concurrent.SimpleTimeLimiter)11 TimeLimiter (com.google.common.util.concurrent.TimeLimiter)6 UncheckedTimeoutException (com.google.common.util.concurrent.UncheckedTimeoutException)5 IOException (java.io.IOException)5 Reader (java.io.Reader)3 ImmutableList (com.google.common.collect.ImmutableList)2 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)2 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)2 IMethod (org.eclipse.jdt.core.IMethod)2 IType (org.eclipse.jdt.core.IType)2 JavaModelException (org.eclipse.jdt.core.JavaModelException)2 IExpr (org.matheclipse.core.interfaces.IExpr)2 MathException (org.matheclipse.parser.client.math.MathException)2 PrestoConnection (com.facebook.presto.jdbc.PrestoConnection)1 PrestoStatement (com.facebook.presto.jdbc.PrestoStatement)1 QueryStats (com.facebook.presto.jdbc.QueryStats)1 QueryBody (com.facebook.presto.sql.tree.QueryBody)1 QuerySpecification (com.facebook.presto.sql.tree.QuerySpecification)1 SingleColumn (com.facebook.presto.sql.tree.SingleColumn)1 State (com.facebook.presto.verifier.QueryResult.State)1