Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
TracePropagatingExecutorService
public
final
class
TracePropagatingExecutorService
extends Object
implements
ExecutorService
| java.lang.Object
|
| ↳ |
com.android.tradefed.invoker.tracing.TracePropagatingExecutorService
|
An executor service that forwards tasks to an underlying implementation while propagating the
tracing context.
This enables using tracing facilities such as CloseableTraceScope in submitted tasks.
Summary
Protected methods |
<T>
Collection<? extends Callable<T>>
|
wrapTasks(Collection<? extends Callable<T>> tasks)
|
Public methods
awaitTermination
public boolean awaitTermination (long timeout,
TimeUnit unit)
| Parameters |
timeout |
long |
unit |
TimeUnit |
| Throws |
InterruptedException |
|
create
public static TracePropagatingExecutorService create (ExecutorService delegate)
Creates an ExecutorService that delegates to the given delegate executor.
Note that the active trace on is that is propagated to tasks is the one active on calls to
the executor method. This is done because TF constructs most objects before starting the
invocation and attaching the trace.
| Parameters |
delegate |
ExecutorService |
execute
public void execute (Runnable command)
| Parameters |
command |
Runnable |
invokeAll
public List<Future<T>> invokeAll (Collection<? extends Callable<T>> tasks)
| Parameters |
tasks |
Collection |
| Throws |
InterruptedException |
|
invokeAll
public List<Future<T>> invokeAll (Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
| Parameters |
tasks |
Collection |
timeout |
long |
unit |
TimeUnit |
| Throws |
InterruptedException |
|
invokeAny
public T invokeAny (Collection<? extends Callable<T>> tasks)
| Parameters |
tasks |
Collection |
| Throws |
ExecutionException |
|
InterruptedException |
|
invokeAny
public T invokeAny (Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
| Parameters |
tasks |
Collection |
timeout |
long |
unit |
TimeUnit |
| Throws |
ExecutionException |
|
InterruptedException |
|
TimeoutException |
|
isShutdown
public boolean isShutdown ()
isTerminated
public boolean isTerminated ()
shutdown
public void shutdown ()
shutdownNow
public List<Runnable> shutdownNow ()
submit
public Future<?> submit (Runnable task)
submit
public Future<T> submit (Callable<T> task)
submit
public Future<T> submit (Runnable task,
T result)
| Parameters |
task |
Runnable |
result |
T |
Protected methods
wrapTasks
protected Collection<? extends Callable<T>> wrapTasks (Collection<? extends Callable<T>> tasks)
| Parameters |
tasks |
Collection |
| Returns |
Collection<? extends Callable<T>> |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-22 UTC."],[],[]]