1/*
2 * This file is a modified version of
3 * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ExecutorService.java?revision=1.51
4 * which contained the following notice:
5 *
6 * Written by Doug Lea with assistance from members of JCP JSR-166
7 * Expert Group and released to the public domain, as explained at
8 * http://creativecommons.org/publicdomain/zero/1.0/
9 */
10
11package java.util.concurrent;
12
13import java.util.Collection;
14import java.util.List;
15
16public interface ExecutorService extends Executor {
17  void shutdown();
18
19  List<Runnable> shutdownNow();
20
21  boolean isShutdown();
22
23  boolean isTerminated();
24
25  boolean awaitTermination(long timeout, TimeUnit unit)
26      throws InterruptedException;
27
28  <T> Future<T> submit(Callable<T> task);
29
30  <T> Future<T> submit(Runnable task, T result);
31
32  Future<?> submit(Runnable task);
33
34  <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
35      throws InterruptedException;
36
37  <T> List<Future<T>> invokeAll(
38      Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
39      throws InterruptedException;
40
41  <T> T invokeAny(Collection<? extends Callable<T>> tasks)
42      throws InterruptedException, ExecutionException;
43
44  <T> T invokeAny(
45      Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
46      throws InterruptedException, ExecutionException, TimeoutException;
47}
48