Package jetbrains.buildServer.util
Class TimedExecutor
- java.lang.Object
-
- jetbrains.buildServer.util.TimedExecutor
-
public class TimedExecutor extends java.lang.Object
Utility class to execute tasks in background with timeout.- Since:
- 8.1
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
<T,E extends java.lang.Throwable>
Texecute(long timeoutMilliseconds, java.lang.Class<E> exceptionClazz, java.util.concurrent.Callable<T> task)
<T> T
execute(long timeoutMilliseconds, java.util.concurrent.Callable<T> task)
static TimedExecutor
withCachedThreadPool(java.lang.String name)
static TimedExecutor
withCachedThreadPool(java.lang.String name, long keepAliveMilliseconds)
static TimedExecutor
withFixedThreadPool(int threadCount, java.lang.String name)
static TimedExecutor
withSingleThreadPool(java.lang.String name)
-
-
-
Method Detail
-
withCachedThreadPool
@NotNull public static TimedExecutor withCachedThreadPool(@NotNull java.lang.String name)
-
withCachedThreadPool
@NotNull public static TimedExecutor withCachedThreadPool(@NotNull java.lang.String name, long keepAliveMilliseconds)
-
withSingleThreadPool
@NotNull public static TimedExecutor withSingleThreadPool(@NotNull java.lang.String name)
-
withFixedThreadPool
@NotNull public static TimedExecutor withFixedThreadPool(int threadCount, @NotNull java.lang.String name)
-
execute
@Nullable public <T> T execute(long timeoutMilliseconds, @NotNull java.util.concurrent.Callable<T> task)
-
execute
@Nullable public <T,E extends java.lang.Throwable> T execute(long timeoutMilliseconds, @NotNull java.lang.Class<E> exceptionClazz, @NotNull java.util.concurrent.Callable<T> task) throws E extends java.lang.Throwable
- Throws:
E extends java.lang.Throwable
-
dispose
public void dispose()
-
-