Class AbstractExecutorService
java.lang.Object
java.util.concurrent.AbstractExecutorService
- All Implemented Interfaces:
Executor, ExecutorService
The
ExecutorService methods that need nothing but execute: a
subclass provides execution and the life cycle, and gets submit,
invokeAll and invokeAny from here.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninvokeAll(Collection<? extends Callable<T>> tasks) Runs every task and answers their futures, all of them done.invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) Runs every task and answers their futures once all are done or the time is up; the ones not done by then are cancelled.<T> TinvokeAny(Collection<? extends Callable<T>> tasks) The result of one of the tasks that completed without failing; the others are cancelled.<T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) AsExecutorService.invokeAny(Collection), giving up with aTimeoutExceptionwhen no task has succeeded in time.protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) Future<?> <T> Future<T> <T> Future<T> Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ExecutorService
awaitTermination, isShutdown, isTerminated, shutdown, shutdownNow
-
Constructor Details
-
AbstractExecutorService
public AbstractExecutorService()
-
-
Method Details
-
newTaskFor
-
newTaskFor
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
submit
- Specified by:
submitin interfaceExecutorService
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException Description copied from interface:ExecutorServiceRuns every task and answers their futures, all of them done.- Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException Description copied from interface:ExecutorServiceRuns every task and answers their futures once all are done or the time is up; the ones not done by then are cancelled.- Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException Description copied from interface:ExecutorServiceThe result of one of the tasks that completed without failing; the others are cancelled.- Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Description copied from interface:ExecutorServiceAsExecutorService.invokeAny(Collection), giving up with aTimeoutExceptionwhen no task has succeeded in time.- Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-