Interface InstrumentedExecutorService
- All Superinterfaces:
Executor
,ExecutorService
,InstrumentedExecutor
,RunnableInstrumenter
- All Known Subinterfaces:
InstrumentedScheduledExecutorService
An
ExecutorService
that has been instrumented to allow for propagation of thread state
and other instrumentation related tasks.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
awaitTermination
(long timeout, @NonNull TimeUnit unit) Implementors can override to specify the targetExecutorService
.default <T> Callable<T>
instrument
(Callable<T> task) Instruments the given callable task.invokeAll
(@NonNull Collection<? extends Callable<T>> tasks) default <T> T
invokeAny
(@NonNull Collection<? extends Callable<T>> tasks) default <T> T
default boolean
default boolean
default void
shutdown()
Methods inherited from interface io.micronaut.scheduling.instrument.InstrumentedExecutor
execute
Methods inherited from interface io.micronaut.scheduling.instrument.RunnableInstrumenter
instrument
-
Method Details
-
getTarget
ExecutorService getTarget()Implementors can override to specify the targetExecutorService
.- Specified by:
getTarget
in interfaceInstrumentedExecutor
- Returns:
- The target
ExecutorService
-
instrument
Instruments the given callable task.- Type Parameters:
T
- The generic return type- Parameters:
task
- the task to instrument- Returns:
- The callable
-
shutdown
default void shutdown()- Specified by:
shutdown
in interfaceExecutorService
-
shutdownNow
- Specified by:
shutdownNow
in interfaceExecutorService
-
isShutdown
default boolean isShutdown()- Specified by:
isShutdown
in interfaceExecutorService
-
isTerminated
default boolean isTerminated()- Specified by:
isTerminated
in interfaceExecutorService
-
awaitTermination
default boolean awaitTermination(long timeout, @NonNull @NonNull TimeUnit unit) throws InterruptedException - Specified by:
awaitTermination
in interfaceExecutorService
- Throws:
InterruptedException
-
submit
- Specified by:
submit
in interfaceExecutorService
-
submit
- Specified by:
submit
in interfaceExecutorService
-
submit
- Specified by:
submit
in interfaceExecutorService
-
invokeAll
@NonNull default <T> @NonNull List<Future<T>> invokeAll(@NonNull @NonNull Collection<? extends Callable<T>> tasks) throws InterruptedException - Specified by:
invokeAll
in interfaceExecutorService
- Throws:
InterruptedException
-
invokeAll
@NonNull default <T> @NonNull List<Future<T>> invokeAll(@NonNull @NonNull Collection<? extends Callable<T>> tasks, long timeout, @NonNull @NonNull TimeUnit unit) throws InterruptedException - Specified by:
invokeAll
in interfaceExecutorService
- Throws:
InterruptedException
-
invokeAny
@NonNull default <T> T invokeAny(@NonNull @NonNull Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - Specified by:
invokeAny
in interfaceExecutorService
- Throws:
InterruptedException
ExecutionException
-
invokeAny
@NonNull default <T> T invokeAny(@NonNull @NonNull Collection<? extends Callable<T>> tasks, long timeout, @NonNull @NonNull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
invokeAny
in interfaceExecutorService
- Throws:
InterruptedException
ExecutionException
TimeoutException
-