ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ExecutorService.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ExecutorService.java (file contents):
Revision 1.13 by dl, Mon Dec 15 00:29:49 2003 UTC vs.
Revision 1.14 by dl, Mon Dec 15 15:41:49 2003 UTC

# Line 33 | Line 33 | public interface ExecutorService extends
33       * representing that task.
34       *
35       * @param task the task to submit
36 +     * @param result the result to return upon completion
37 +     * If you do not need a particular result, consider using <tt>Boolean.TRUE</tt>.
38       * @return a Future representing pending completion of the task,
39 <     * and whose <tt>get()</tt> method will return an arbitrary value
39 >     * and whose <tt>get()</tt> method will return the given value
40       * upon completion
41       * @throws RejectedExecutionException if task cannot be scheduled
42       * for execution
43       */
44 <    Future<?> submit(Runnable task);
44 >    <T> Future<T> submit(Runnable task, T result);
45  
46      /**
47       * Submits a value-returning task for execution and returns a Future
# Line 166 | Line 168 | public interface ExecutorService extends
168       * Note that a <em>completed</em> task could have
169       * terminated either normally or by throwing an exception.
170       * @param tasks the collection of tasks
171 +     * @param result value for each task to return upon completion.
172 +     * If you do not need a particular result, consider using <tt>Boolean.TRUE</tt>.
173       * @return A list of Futures representing the tasks, in the same
174       * sequential order as the given task list. If the task list is
175       * non-empty, at least one element of this list is known to have
# Line 176 | Line 180 | public interface ExecutorService extends
180       * @throws RejectedExecutionException if any task cannot be scheduled
181       * for execution
182       */
183 <    List<Future<?>> runAny(List<Runnable> tasks)
183 >    <T> List<Future<T>> invokeAny(List<Runnable> tasks, T result)
184          throws InterruptedException;
185  
186      /**
# Line 186 | Line 190 | public interface ExecutorService extends
190       * Note that a <em>completed</em> task could have
191       * terminated either normally or by throwing an exception.
192       * @param tasks the collection of tasks
193 +     * @param result value for each task to return upon completion.
194 +     * If you do not need a particular result, consider using <tt>Boolean.TRUE</tt>.
195       * @param timeout the maximum time to wait
196       * @param unit the time unit of the timeout argument
197       * @return A list of Futures representing the tasks, in the same
# Line 199 | Line 205 | public interface ExecutorService extends
205       * @throws RejectedExecutionException if any task cannot be scheduled
206       * for execution
207       */
208 <    List<Future<?>> runAny(List<Runnable> tasks,
209 <                           long timeout, TimeUnit unit)
208 >    <T> List<Future<T>> invokeAny(List<Runnable> tasks, T result,
209 >                               long timeout, TimeUnit unit)
210          throws InterruptedException;
211  
212  
# Line 210 | Line 216 | public interface ExecutorService extends
216       * Note that a <em>completed</em> task could have
217       * terminated either normally or by throwing an exception.
218       * @param tasks the collection of tasks
219 +     * @param result value for each task to return upon completion.
220 +     * If you do not need a particular result, consider using <tt>Boolean.TRUE</tt>.
221       * @return A list of Futures representing the tasks, in the same
222       * sequential order as the given task list, each of which has
223       * completed.
# Line 219 | Line 227 | public interface ExecutorService extends
227       * @throws RejectedExecutionException if any task cannot be scheduled
228       * for execution
229       */
230 <    List<Future<?>> runAll(List<Runnable> tasks)
230 >    <T> List<Future<T>> invokeAll(List<Runnable> tasks, T result)
231          throws InterruptedException;
232  
233      /**
# Line 230 | Line 238 | public interface ExecutorService extends
238       * Note that a <em>completed</em> task could have
239       * terminated either normally or by throwing an exception.
240       * @param tasks the collection of tasks
241 +     * @param result value for each task to return upon completion.
242 +     * If you do not need a particular result, consider using <tt>Boolean.TRUE</tt>.
243       * @param timeout the maximum time to wait
244       * @return A list of Futures representing the tasks, in the same
245       * sequential order as the given task list. If the operation did
# Line 242 | Line 252 | public interface ExecutorService extends
252       * @throws RejectedExecutionException if any task cannot be scheduled
253       * for execution
254       */
255 <    List<Future<?>> runAll(List<Runnable> tasks,
256 <                              long timeout, TimeUnit unit)
255 >    <T> List<Future<T>> invokeAll(List<Runnable> tasks, T result,
256 >                               long timeout, TimeUnit unit)
257          throws InterruptedException;
258  
259      /**
# Line 264 | Line 274 | public interface ExecutorService extends
274       * for execution
275       */
276  
277 <    <T> List<Future<T>> callAny(List<Callable<T>> tasks)
277 >    <T> List<Future<T>> invokeAny(List<Callable<T>> tasks)
278          throws InterruptedException;
279  
280      /**
# Line 288 | Line 298 | public interface ExecutorService extends
298       * @throws RejectedExecutionException if any task cannot be scheduled
299       * for execution
300       */
301 <    <T> List<Future<T>> callAny(List<Callable<T>> tasks,
301 >    <T> List<Future<T>> invokeAny(List<Callable<T>> tasks,
302                                  long timeout, TimeUnit unit)
303          throws InterruptedException;
304  
# Line 308 | Line 318 | public interface ExecutorService extends
318       * for execution
319       */
320  
321 <    <T> List<Future<T>> callAll(List<Callable<T>> tasks)
321 >    <T> List<Future<T>> invokeAll(List<Callable<T>> tasks)
322          throws InterruptedException;
323  
324      /**
# Line 331 | Line 341 | public interface ExecutorService extends
341       * @throws RejectedExecutionException if any task cannot be scheduled
342       * for execution
343       */
344 <    <T> List<Future<T>> callAll(List<Callable<T>> tasks,
344 >    <T> List<Future<T>> invokeAll(List<Callable<T>> tasks,
345                                  long timeout, TimeUnit unit)
346          throws InterruptedException;
347  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines