Name
AbstractExecutorService
Synopsis
This abstract class implements the
submit( ), invokeAll( ), and
invokeAny( ) methods of the
ExecutorService interface. It does not implement
the ExecutorService shutdown methods or the
crucial execute( ) method for asynchronous
execution of Runnable tasks.
The methods implemented by AbstractExecutorService
wrap the submitted Callable or
Runnable task in a FutureTask
object. FutureTask implements
Runnable and Future, which are
first passed to the abstract execute( ) method to
be run asynchronously and then returned to the caller.
See ThreadPoolExecutor for a concrete
implementation, and see Executors for convenient
ExecutorService factory methods.
Figure 16-70. java.util.concurrent.AbstractExecutorService
public abstract class AbstractExecutorService implements ExecutorService { // Public Constructors public AbstractExecutorService( ); // Methods Implementing ExecutorService public <T> java.util.List<Future<T>> invokeAll(java.util.Collection<Callable<T>> tasks) throws InterruptedException; public <T> java.util.List<Future<T>> invokeAll(java.util.Collection<Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException; public <T> T invokeAny(java.util.Collection<Callable<T>> tasks) throws InterruptedException, ExecutionException; public <T> T invokeAny(java.util.Collection<Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access