TracePropagatingExecutorService
public
final
class
TracePropagatingExecutorService
extends Object
implements
ExecutorService
| 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>
List<Future<T>>
|
invokeAll(Collection<? extends Callable<T>> tasks)
|
<T>
List<Future<T>>
|
invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
|
<T>
T
|
invokeAny(Collection<? extends Callable<T>> tasks)
|
<T>
T
|
invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
|
boolean
|
isShutdown()
|
boolean
|
isTerminated()
|
void
|
shutdown()
|
List<Runnable>
|
shutdownNow()
|
Future<?>
|
submit(Runnable task)
|
<T>
Future<T>
|
submit(Callable<T> task)
|
<T>
Future<T>
|
submit(Runnable task, T result)
|
受保護的方法 | |
|---|---|
<T>
Collection<? extends Callable<T>>
|
wrapTasks(Collection<? extends Callable<T>> tasks)
|
公用方法
awaitTermination
public boolean awaitTermination (long timeout,
TimeUnit unit)| 參數 | |
|---|---|
timeout |
long |
unit |
TimeUnit |
| 傳回 | |
|---|---|
boolean |
|
| 擲回 | |
|---|---|
InterruptedException |
|
create
public static TracePropagatingExecutorService create (ExecutorService delegate)
建立委派給指定委派執行器的 ExecutorService。
請注意,傳播至工作上的有效追蹤記錄,是呼叫執行器方法時有效的追蹤記錄。這是因為 TF 會在開始叫用及附加追蹤記錄前,建構大部分的物件。
| 參數 | |
|---|---|
delegate |
ExecutorService |
| 傳回 | |
|---|---|
TracePropagatingExecutorService |
|
execute
public void execute (Runnable command)
| 參數 | |
|---|---|
command |
Runnable |
invokeAll
public List<Future<T>> invokeAll (Collection<? extends Callable<T>> tasks)
| 參數 | |
|---|---|
tasks |
Collection |
| 傳回 | |
|---|---|
List<Future<T>> |
|
| 擲回 | |
|---|---|
InterruptedException |
|
invokeAll
public List<Future<T>> invokeAll (Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)| 參數 | |
|---|---|
tasks |
Collection |
timeout |
long |
unit |
TimeUnit |
| 傳回 | |
|---|---|
List<Future<T>> |
|
| 擲回 | |
|---|---|
InterruptedException |
|
invokeAny
public T invokeAny (Collection<? extends Callable<T>> tasks)
| 參數 | |
|---|---|
tasks |
Collection |
| 傳回 | |
|---|---|
T |
|
| 擲回 | |
|---|---|
ExecutionException |
|
InterruptedException |
|
invokeAny
public T invokeAny (Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)| 參數 | |
|---|---|
tasks |
Collection |
timeout |
long |
unit |
TimeUnit |
| 傳回 | |
|---|---|
T |
|
| 擲回 | |
|---|---|
ExecutionException |
|
InterruptedException |
|
TimeoutException |
|
isShutdown
public boolean isShutdown ()
| 傳回 | |
|---|---|
boolean |
|
isTerminated
public boolean isTerminated ()
| 傳回 | |
|---|---|
boolean |
|
關機
public void shutdown ()
shutdownNow
public List<Runnable> shutdownNow ()
| 傳回 | |
|---|---|
List<Runnable> |
|
提交
public Future<?> submit (Runnable task)
| 參數 | |
|---|---|
task |
Runnable |
| 傳回 | |
|---|---|
Future<?> |
|
提交
public Future<T> submit (Callable<T> task)
| 參數 | |
|---|---|
task |
Callable |
| 傳回 | |
|---|---|
Future<T> |
|
提交
public Future<T> submit (Runnable task,
T result)| 參數 | |
|---|---|
task |
Runnable |
result |
T |
| 傳回 | |
|---|---|
Future<T> |
|
受保護的方法
wrapTasks
protected Collection<? extends Callable<T>> wrapTasks (Collection<? extends Callable<T>> tasks)
| 參數 | |
|---|---|
tasks |
Collection |
| 傳回 | |
|---|---|
Collection<? extends Callable<T>> |
|