14 |
|
|
15 |
|
/** |
16 |
|
* Factory and utility methods for {@link Executor}, {@link |
17 |
< |
* ExecutorService}, and {@link ThreadFactory} classes defined in this |
18 |
< |
* package. |
17 |
> |
* ExecutorService}, {@link ScheduledExecutorService}, {@link |
18 |
> |
* ThreadFactory}, and {@link Callable} classes defined in this |
19 |
> |
* package. This class supports the following kinds of methods: |
20 |
> |
* |
21 |
> |
* <ul> |
22 |
> |
* <li> Methods that create and return an {@link ExecutorService} |
23 |
> |
* set up with commonly useful configuration settings. |
24 |
> |
* <li> Methods that create and return a {@link ScheduledExecutorService} |
25 |
> |
* set up with commonly useful configuration settings. |
26 |
> |
* <li> Methods that create and return a "wrapped" ExecutorService, that |
27 |
> |
* disables reconfiguration by making implementation-specific methods |
28 |
> |
* inaccessible. |
29 |
> |
* <li> Methods that create and return a {@link ThreadFactory} |
30 |
> |
* that sets newly created threads to a known state. |
31 |
> |
* <li> Methods that create a return a {@link Callable} |
32 |
> |
* out of other closure-like forms, so they can be used |
33 |
> |
* in execution methods requiring <tt>Callable</tt> |
34 |
> |
* </ul> |
35 |
|
* |
36 |
|
* @since 1.5 |
37 |
|
* @author Doug Lea |
580 |
|
public <T> Future<T> submit(Callable<T> task) { |
581 |
|
return e.submit(task); |
582 |
|
} |
583 |
< |
public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks) |
583 |
> |
public <T> Future<T> submit(Runnable task, T result) { |
584 |
> |
return e.submit(task, result); |
585 |
> |
} |
586 |
> |
public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks) |
587 |
|
throws InterruptedException { |
588 |
|
return e.invokeAll(tasks); |
589 |
|
} |