41 |
|
public List shutdownNow() { return e.shutdownNow(); } |
42 |
|
public boolean isShutdown() { return e.isShutdown(); } |
43 |
|
public boolean isTerminated() { return e.isTerminated(); } |
44 |
– |
public boolean remove(Runnable r) { return e.remove(r) ; } |
44 |
|
public boolean awaitTermination(long timeout, TimeUnit unit) |
45 |
|
throws InterruptedException { |
46 |
|
return e.awaitTermination(timeout, unit); |
158 |
|
* @param task the task to submit |
159 |
|
* @param value the value which will become the return value of |
160 |
|
* the task upon task completion |
161 |
< |
* @return a CancellableTask that allows cancellation. |
161 |
> |
* @return a Future representing pending completion of the task |
162 |
|
* @throws CannotExecuteException if the task cannot be scheduled |
163 |
|
* for execution |
164 |
|
*/ |
165 |
< |
public static CancellableTask execute(Executor executor, Runnable task) { |
166 |
< |
CancellableTask ftask = new CancellableTask(task); |
165 |
> |
public static <T> Future<T> execute(Executor executor, Runnable task, T value) { |
166 |
> |
FutureTask<T> ftask = new FutureTask<T>(task, value); |
167 |
|
executor.execute(ftask); |
168 |
|
return ftask; |
169 |
|
} |