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
AnExecutorServicethat allows to obtain a list of tasks that were still running when anattempt to force terminatewas made.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTaskTrackingExecutor.ForcedTerminationAftermathReturned bytryForceTerminate().static classTaskTrackingExecutor.TaskTrackingExecutorDecoratorA decorator for anExecutorServicethat makes its target aTaskTrackingExecutor.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidawaitTermination()default Awaitable.WithUnittoAwaitableOfEnforcedTermination()default Awaitable.WithUnittoAwaitableOfTermination()TaskTrackingExecutor.ForcedTerminationAftermathtryForceTerminate()CallsExecutorService.shutdownNow()and returns an object containing aListof tasks, that were still running right before the call.-
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 aListof tasks, that were still running right before the call. The returned object also contains theListof tasks returned byExecutorService.shutdownNow()itself.
-
toAwaitableOfTermination
default Awaitable.WithUnit toAwaitableOfTermination()
-
toAwaitableOfEnforcedTermination
default Awaitable.WithUnit toAwaitableOfEnforcedTermination()
-
awaitTermination
default void awaitTermination() throws InterruptedException- Throws:
InterruptedException
-
-