public interface InstrumentedExecutorService extends ExecutorService, InstrumentedExecutor
ExecutorService
that has been instrumented to allow for propagation of thread state
and other instrumentation related tasks.Modifier and Type | Method and Description |
---|---|
default boolean |
awaitTermination(long timeout,
TimeUnit unit) |
ExecutorService |
getTarget()
Implementors can override to specify the target
ExecutorService . |
default <T> Callable<T> |
instrument(Callable<T> task)
Instruments the given callable task.
|
default <T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks) |
default <T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
default <T> T |
invokeAny(Collection<? extends Callable<T>> tasks) |
default <T> T |
invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
default boolean |
isShutdown() |
default boolean |
isTerminated() |
default void |
shutdown() |
default List<Runnable> |
shutdownNow() |
default <T> Future<T> |
submit(Callable<T> task) |
default Future<?> |
submit(Runnable task) |
default <T> Future<T> |
submit(Runnable task,
T result) |
execute
instrument
ExecutorService getTarget()
ExecutorService
.getTarget
in interface InstrumentedExecutor
ExecutorService
default <T> Callable<T> instrument(Callable<T> task)
T
- The generic return typetask
- the task to instrumentdefault void shutdown()
shutdown
in interface ExecutorService
default List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
default boolean isShutdown()
isShutdown
in interface ExecutorService
default boolean isTerminated()
isTerminated
in interface ExecutorService
default boolean awaitTermination(long timeout, @NonNull TimeUnit unit) throws InterruptedException
awaitTermination
in interface ExecutorService
InterruptedException
@NonNull default <T> Future<T> submit(@NonNull Callable<T> task)
submit
in interface ExecutorService
@NonNull default <T> Future<T> submit(@NonNull Runnable task, T result)
submit
in interface ExecutorService
@NonNull default Future<?> submit(@NonNull Runnable task)
submit
in interface ExecutorService
@NonNull default <T> List<Future<T>> invokeAll(@NonNull Collection<? extends Callable<T>> tasks) throws InterruptedException
invokeAll
in interface ExecutorService
InterruptedException
@NonNull default <T> List<Future<T>> invokeAll(@NonNull Collection<? extends Callable<T>> tasks, long timeout, @NonNull TimeUnit unit) throws InterruptedException
invokeAll
in interface ExecutorService
InterruptedException
@NonNull default <T> T invokeAny(@NonNull Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
invokeAny
in interface ExecutorService
InterruptedException
ExecutionException
@NonNull default <T> T invokeAny(@NonNull Collection<? extends Callable<T>> tasks, long timeout, @NonNull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
invokeAny
in interface ExecutorService
InterruptedException
ExecutionException
TimeoutException