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 | |
---|---|
boolean
|
awaitTermination(long timeout, TimeUnit unit)
|
static
TracePropagatingExecutorService
|
create(ExecutorService delegate)
Creates an |
void
|
execute(Runnable command)
|
<T>
|
invokeAll(
|
<T>
|
invokeAll(
|
<T>
T
|
invokeAny(
|
<T>
T
|
invokeAny(
|
boolean
|
isShutdown()
|
boolean
|
isTerminated()
|
void
|
shutdown()
|
|
shutdownNow()
|
|
submit(Runnable task)
|
<T>
|
submit(Runnable task, T result)
|
<T>
|
submit(
|
Protected methods | |
---|---|
<T>
|
wrapTasks(
|
Public methods
awaitTermination
public boolean awaitTermination (long timeout, TimeUnit unit)
Parameters | |
---|---|
timeout |
long |
unit |
TimeUnit |
Returns | |
---|---|
boolean |
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 |
Returns | |
---|---|
TracePropagatingExecutorService |
execute
public void execute (Runnable command)
Parameters | |
---|---|
command |
Runnable |
invokeAll
publicinvokeAll ( tasks, long timeout, TimeUnit unit)
Parameters | |
---|---|
tasks |
|
timeout |
long |
unit |
TimeUnit |
Returns | |
---|---|
|
invokeAll
publicinvokeAll ( tasks)
Parameters | |
---|---|
tasks |
|
Returns | |
---|---|
|
invokeAny
public T invokeAny (tasks)
Parameters | |
---|---|
tasks |
|
Returns | |
---|---|
T |
invokeAny
public T invokeAny (tasks, long timeout, TimeUnit unit)
Parameters | |
---|---|
tasks |
|
timeout |
long |
unit |
TimeUnit |
Returns | |
---|---|
T |
isShutdown
public boolean isShutdown ()
Returns | |
---|---|
boolean |
isTerminated
public boolean isTerminated ()
Returns | |
---|---|
boolean |
shutdown
public void shutdown ()
shutdownNow
publicshutdownNow ()
Returns | |
---|---|
|
submit
publicsubmit (Runnable task)
Parameters | |
---|---|
task |
Runnable |
Returns | |
---|---|
|
submit
publicsubmit (Runnable task, T result)
Parameters | |
---|---|
task |
Runnable |
result |
T |
Returns | |
---|---|
|
submit
publicsubmit ( task)
Parameters | |
---|---|
task |
|
Returns | |
---|---|
|
Protected methods
wrapTasks
protectedwrapTasks ( tasks)
Parameters | |
---|---|
tasks |
|
Returns | |
---|---|
|