Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.

public abstract class AbstractExecutorService

  1. Object
  2. AbstractExecutorService

ImplementsExecutor, 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.

Constructors

public AbstractExecutorService()

Methods

protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value)
protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable)
public Future<?> submit(Runnable task)
public <T> Future<T> submit(Runnable task, T result)
public <T> Future<T> submit(Callable<T> task)
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedExceptionRuns every task and answers their futures, all of them done.
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedExceptionRuns every task and answers their futures once all are done or the time is up; the ones not done by then are cancelled.
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionExceptionThe result of one of the tasks that completed without failing; the others are cancelled.
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutExceptionAs invokeAny(Collection), giving up with a TimeoutException when no task has succeeded in time.

Inherited methods

Constructor details

AbstractExecutorService

public AbstractExecutorService()

Method details

newTaskFor

protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value)

newTaskFor

protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable)

submit

public Future<?> submit(Runnable task)

submit

public <T> Future<T> submit(Runnable task, T result)

submit

public <T> Future<T> submit(Callable<T> task)

invokeAll

public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
Runs every task and answers their futures, all of them done.

invokeAll

public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
Runs every task and answers their futures once all are done or the time is up; the ones not done by then are cancelled.

invokeAny

public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
The result of one of the tasks that completed without failing; the others are cancelled.

invokeAny

public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
As invokeAny(Collection), giving up with a TimeoutException when no task has succeeded in time.