Package jetbrains.buildServer.util
Class TimedExecutor
- java.lang.Object
-
- jetbrains.buildServer.util.TimedExecutor
-
public class TimedExecutor extends 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 Throwable>
Texecute(long timeoutMilliseconds, Class<E> exceptionClazz, Callable<T> task)
<T> T
execute(long timeoutMilliseconds, Callable<T> task)
static TimedExecutor
withCachedThreadPool(String name)
static TimedExecutor
withCachedThreadPool(String name, long keepAliveMilliseconds)
static TimedExecutor
withFixedThreadPool(int threadCount, String name)
static TimedExecutor
withSingleThreadPool(String name)
-
-
-
Method Detail
-
withCachedThreadPool
@NotNull public static TimedExecutor withCachedThreadPool(@NotNull String name)
-
withCachedThreadPool
@NotNull public static TimedExecutor withCachedThreadPool(@NotNull String name, long keepAliveMilliseconds)
-
withSingleThreadPool
@NotNull public static TimedExecutor withSingleThreadPool(@NotNull String name)
-
withFixedThreadPool
@NotNull public static TimedExecutor withFixedThreadPool(int threadCount, @NotNull String name)
-
execute
@Nullable public <T> T execute(long timeoutMilliseconds, @NotNull Callable<T> task)
-
execute
@Nullable public <T,E extends Throwable> T execute(long timeoutMilliseconds, @NotNull Class<E> exceptionClazz, @NotNull Callable<T> task) throws E extends Throwable
- Throws:
E extends Throwable
-
dispose
public void dispose()
-
-