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