TracePropagatingExecutorService
public
final
class
TracePropagatingExecutorService
extends Object
java.lang.Object | |
↳ | com.android.tradefed.invoker.tracing.TracePropagatingExecutorService |
执行器服务,用于将任务转发到底层实现,同时传播跟踪记录上下文。
这样一来,便可以在提交的任务中使用 CloseableTraceScope
等跟踪功能。
摘要
公共方法 | |
---|---|
boolean
|
awaitTermination(long timeout, TimeUnit unit)
|
static
TracePropagatingExecutorService
|
create(ExecutorService delegate)
创建一个委托给给定委托执行程序的 |
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(
|
受保护的方法 | |
---|---|
<T>
|
wrapTasks(
|
公共方法
awaitTermination
public boolean awaitTermination (long timeout, TimeUnit unit)
参数 | |
---|---|
timeout |
long |
unit |
TimeUnit |
返回 | |
---|---|
boolean |
create
public static TracePropagatingExecutorService create (ExecutorService delegate)
创建一个委托给给定委托执行器的 ERROR(/ExecutorService)
。
请注意,传播到任务的有效轨迹是调用执行器方法时有效的轨迹。之所以这样做,是因为 TF 会在开始调用并附加轨迹之前构建大多数对象。
参数 | |
---|---|
delegate |
ExecutorService |
返回 | |
---|---|
TracePropagatingExecutorService |
execute
public void execute (Runnable command)
参数 | |
---|---|
command |
Runnable |
invokeAll
publicinvokeAll ( tasks, long timeout, TimeUnit unit)
参数 | |
---|---|
tasks |
|
timeout |
long |
unit |
TimeUnit |
返回 | |
---|---|
|
invokeAll
publicinvokeAll ( tasks)
参数 | |
---|---|
tasks |
|
返回 | |
---|---|
|
invokeAny
public T invokeAny (tasks)
参数 | |
---|---|
tasks |
|
返回 | |
---|---|
T |
invokeAny
public T invokeAny (tasks, long timeout, TimeUnit unit)
参数 | |
---|---|
tasks |
|
timeout |
long |
unit |
TimeUnit |
返回 | |
---|---|
T |
isShutdown
public boolean isShutdown ()
返回 | |
---|---|
boolean |
isTerminated
public boolean isTerminated ()
返回 | |
---|---|
boolean |
关机
public void shutdown ()
shutdownNow
publicshutdownNow ()
返回 | |
---|---|
|
提交
publicsubmit (Runnable task)
参数 | |
---|---|
task |
Runnable |
返回 | |
---|---|
|
提交
publicsubmit (Runnable task, T result)
参数 | |
---|---|
task |
Runnable |
result |
T |
返回 | |
---|---|
|
提交
publicsubmit ( task)
参数 | |
---|---|
task |
|
返回 | |
---|---|
|
受保护的方法
wrapTasks
protectedwrapTasks ( tasks)
参数 | |
---|---|
tasks |
|
返回 | |
---|---|
|