• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 package java.util.concurrent;
12 
13 import java.util.Collection;
14 import java.util.List;
15 
16 public interface ExecutorService extends Executor {
shutdown()17   void shutdown();
18 
shutdownNow()19   List<Runnable> shutdownNow();
20 
isShutdown()21   boolean isShutdown();
22 
isTerminated()23   boolean isTerminated();
24 
awaitTermination(long timeout, TimeUnit unit)25   boolean awaitTermination(long timeout, TimeUnit unit)
26       throws InterruptedException;
27 
submit(Callable<T> task)28   <T> Future<T> submit(Callable<T> task);
29 
submit(Runnable task, T result)30   <T> Future<T> submit(Runnable task, T result);
31 
submit(Runnable task)32   Future<?> submit(Runnable task);
33 
invokeAll(Collection<? extends Callable<T>> tasks)34   <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
35       throws InterruptedException;
36 
invokeAll( Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)37   <T> List<Future<T>> invokeAll(
38       Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
39       throws InterruptedException;
40 
invokeAny(Collection<? extends Callable<T>> tasks)41   <T> T invokeAny(Collection<? extends Callable<T>> tasks)
42       throws InterruptedException, ExecutionException;
43 
invokeAny( Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)44   <T> T invokeAny(
45       Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
46       throws InterruptedException, ExecutionException, TimeoutException;
47 }
48