public final class ExecutorServiceUtil extends Object
ExecutorService
class functionalityModifier and Type | Class and Description |
---|---|
static class |
ExecutorServiceUtil.CallableTaskWrapper<T>
Executor task wrapper to enhance task cancellation behavior
|
Modifier and Type | Method and Description |
---|---|
static <T> Future<T> |
submit(ExecutorService service,
Callable<T> callable)
Helper method to submit the callabale task, gets the original future object, and wrap it
in another future object with the ability to decorate the
Future.cancel(boolean) method;
this decorator will block when future cancellation is invoked (and the "mayInterruptIfRunning"
parameter is set to true). |
public static <T> Future<T> submit(ExecutorService service, Callable<T> callable)
Future.cancel(boolean)
method;
this decorator will block when future cancellation is invoked (and the "mayInterruptIfRunning"
parameter is set to true).service
- the executor servicecallable
- a callable taskExecutorService#submit(Callable)
Copyright © 1970 The Apache Software Foundation. All rights reserved.