@GwtIncompatible public final class ExecutionList extends ObjectA support class for
ListenableFutureimplementations to manage their listeners. An instance contains a list of listeners, each with an associated
Executor, and guarantees that every
Runnablethat is added will be executed after
execute()is called. Any
Runnableadded after the call to
executeis still guaranteed to execute. There is no guarantee, however, that listeners will be executed in the order that they are added.
Exceptions thrown by a listener will be propagated up to the executor. Any exception thrown during
RejectedExecutionExceptionor an exception thrown by direct execution) will be caught and logged.
- Nishant Thakkar, Sven Mawson
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
add(Runnable runnable, Executor executor)Adds the
Executorto the list of listeners to execute.
execute()Runs this execution list, executing all existing pairs in the order they were added.
Executorto the list of listeners to execute. If execution has already begun, the listener is executed immediately.
When selecting an executor, note that
directExecutoris dangerous in some cases. See the discussion in the
public void execute()Runs this execution list, executing all existing pairs in the order they were added. However, note that listeners added after this point may be executed before those previously added, and note that the execution order of all listeners is ultimately chosen by the implementations of the supplied executors.
This method is idempotent. Calling it several times in parallel is semantically equivalent to calling it exactly once.
- 10.0 (present in 1.0 as