Package pl.morgwai.base.utils.concurrent
Interface TaskTrackingExecutor
-
- All Superinterfaces:
Executor
,ExecutorService
- All Known Implementing Classes:
ScheduledTaskTrackingThreadPoolExecutor
,TaskTrackingExecutor.TaskTrackingExecutorDecorator
,TaskTrackingThreadPoolExecutor
public interface TaskTrackingExecutor extends ExecutorService
AnExecutorService
that allows to obtain a list of tasks that were still running when anattempt to force terminate
was made.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TaskTrackingExecutor.ForcedTerminationAftermath
Returned bytryForceTerminate()
.static class
TaskTrackingExecutor.TaskTrackingExecutorDecorator
A decorator for anExecutorService
that makes its target aTaskTrackingExecutor
.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
awaitTermination()
default Awaitable.WithUnit
toAwaitableOfEnforcedTermination()
default Awaitable.WithUnit
toAwaitableOfTermination()
TaskTrackingExecutor.ForcedTerminationAftermath
tryForceTerminate()
CallsExecutorService.shutdownNow()
and returns an object containing a list of tasks that were still running when this method was called, together with the list of tasks returned byExecutorService.shutdownNow()
.-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
-
-
-
-
Method Detail
-
tryForceTerminate
TaskTrackingExecutor.ForcedTerminationAftermath tryForceTerminate()
CallsExecutorService.shutdownNow()
and returns an object containing a list of tasks that were still running when this method was called, together with the list of tasks returned byExecutorService.shutdownNow()
.
-
toAwaitableOfTermination
default Awaitable.WithUnit toAwaitableOfTermination()
-
toAwaitableOfEnforcedTermination
default Awaitable.WithUnit toAwaitableOfEnforcedTermination()
-
awaitTermination
default void awaitTermination() throws InterruptedException
- Throws:
InterruptedException
-
-