TracePropagatingExecutorService
public
final
class
TracePropagatingExecutorService
extends Object
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
Public methods
awaitTermination
public boolean awaitTermination (long timeout,
TimeUnit unit)
Parameters |
timeout |
long |
unit |
TimeUnit |
create
public static TracePropagatingExecutorService create (ExecutorService delegate)
Creates an ERROR(/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 invokeAll ( tasks,
long timeout,
TimeUnit unit)
Parameters |
tasks |
|
timeout |
long |
unit |
TimeUnit |
invokeAll
public invokeAll ( tasks)
invokeAny
public T invokeAny ( tasks)
invokeAny
public T invokeAny ( tasks,
long timeout,
TimeUnit unit)
Parameters |
tasks |
|
timeout |
long |
unit |
TimeUnit |
isShutdown
public boolean isShutdown ()
isTerminated
public boolean isTerminated ()
shutdown
public void shutdown ()
shutdownNow
public shutdownNow ()
submit
public submit (Runnable task)
submit
public submit (Runnable task,
T result)
Parameters |
task |
Runnable |
result |
T |
submit
public submit ( task)
Protected methods
wrapTasks
protected wrapTasks ( tasks)