Interface InstrumentedExecutorService
- All Superinterfaces:
Executor,ExecutorService,InstrumentedExecutor,RunnableInstrumenter
- All Known Subinterfaces:
InstrumentedScheduledExecutorService
- All Known Implementing Classes:
ContextPropagatingExecutorService,ContextPropagatingScheduledExecutorService
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 booleanawaitTermination(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> TinvokeAny(@NonNull Collection<? extends Callable<T>> tasks) default <T> Tdefault booleandefault booleandefault voidshutdown()Methods inherited from interface io.micronaut.scheduling.instrument.InstrumentedExecutor
executeMethods inherited from interface io.micronaut.scheduling.instrument.RunnableInstrumenter
instrument
-
Method Details
-
getTarget
ExecutorService getTarget()Implementors can override to specify the targetExecutorService.- Specified by:
getTargetin 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:
shutdownin interfaceExecutorService
-
shutdownNow
- Specified by:
shutdownNowin interfaceExecutorService
-
isShutdown
default boolean isShutdown()- Specified by:
isShutdownin interfaceExecutorService
-
isTerminated
default boolean isTerminated()- Specified by:
isTerminatedin interfaceExecutorService
-
awaitTermination
default boolean awaitTermination(long timeout, @NonNull @NonNull TimeUnit unit) throws InterruptedException - Specified by:
awaitTerminationin interfaceExecutorService- Throws:
InterruptedException
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
invokeAll
@NonNull default <T> @NonNull List<Future<T>> invokeAll(@NonNull @NonNull Collection<? extends Callable<T>> tasks) throws InterruptedException - Specified by:
invokeAllin 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:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAny
@NonNull default <T> T invokeAny(@NonNull @NonNull Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionException
-
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:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-