152 |
|
* @param value the value which will become the return value of |
153 |
|
* the task upon task completion |
154 |
|
* @return a Future representing pending completion of the task |
155 |
< |
* @throws ExecutionException if the task cannot be scheduled |
155 |
> |
* @throws RejectedExecutionException if task cannot be scheduled |
156 |
|
* for execution |
157 |
|
*/ |
158 |
|
public static <T> Future<T> execute(Executor executor, Runnable task, T value) { |
174 |
|
* @param executor the Executor to which the task will be submitted |
175 |
|
* @param task the task to submit |
176 |
|
* @return a Future representing pending completion of the task |
177 |
< |
* @throws ExecutionException if task cannot be scheduled for execution |
177 |
> |
* @throws RejectedExecutionException if task cannot be scheduled |
178 |
> |
* for execution |
179 |
|
*/ |
180 |
|
public static <T> FutureTask<T> execute(Executor executor, Callable<T> task) { |
181 |
|
FutureTask<T> ftask; |
195 |
|
* |
196 |
|
* @param executor the Executor to which the task will be submitted |
197 |
|
* @param task the task to submit |
198 |
< |
* @throws ExecutionException if task cannot be scheduled for execution |
198 |
> |
* @throws RejectedExecutionException if task cannot be scheduled |
199 |
> |
* for execution |
200 |
|
*/ |
201 |
|
public static void invoke(Executor executor, Runnable task) |
202 |
|
throws ExecutionException, InterruptedException { |
212 |
|
* @param executor the Executor to which the task will be submitted |
213 |
|
* @param task the task to submit |
214 |
|
* @return a Future representing pending completion of the task |
215 |
< |
* @throws ExecutionException if task cannot be scheduled for execution |
215 |
> |
* @throws RejectedExecutionException if task cannot be scheduled |
216 |
> |
* for execution |
217 |
|
*/ |
218 |
|
public static <T> T invoke(Executor executor, Callable<T> task) |
219 |
|
throws ExecutionException, InterruptedException { |