Class ExecutionList

java.lang.Object
com.google.common.util.concurrent.ExecutionList

@Deprecated(since="2022-12-01") public final class ExecutionList extends Object
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023

A list of listeners, each with an associated Executor, that guarantees that every Runnable that is added will be executed after execute() is called. Any Runnable added after the call to execute is 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 Executor.execute (e.g., a RejectedExecutionException or an exception thrown by inline execution) will be caught and logged.

Since:
1.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Creates a new, empty ExecutionList.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Runnable runnable, Executor executor)
    Deprecated.
    Adds the Runnable and accompanying Executor to the list of listeners to execute.
    void
    Deprecated.
    Runs this execution list, executing all existing pairs in the order they were added.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExecutionList

      public ExecutionList()
      Deprecated.
      Creates a new, empty ExecutionList.
  • Method Details

    • add

      public void add(Runnable runnable, Executor executor)
      Deprecated.
      Adds the Runnable and accompanying Executor to the list of listeners to execute. If execution has already begun, the listener is executed immediately.

      Note: For fast, lightweight listeners that would be safe to execute in any thread, consider MoreExecutors.sameThreadExecutor(). For heavier listeners, sameThreadExecutor() carries some caveats: First, the thread that the listener runs in depends on whether the ExecutionList has been executed at the time it is added. In particular, listeners may run in the thread that calls add. Second, the thread that calls execute() may be an internal implementation thread, such as an RPC network thread, and sameThreadExecutor() listeners may run in this thread. Finally, during the execution of a sameThreadExecutor listener, all other registered but unexecuted listeners are prevented from running, even if those listeners are to run in other executors.

    • execute

      public void execute()
      Deprecated.
      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.

      Since:
      10.0 (present in 1.0 as run)