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)

यह एक ExecutorService बनाता है, जो दिए गए डेलिगेट एक्ज़ीक्यूटर को डेलिगेट करता है.

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

बनाएं

public static TracePropagatingExecutorService create (ExecutorService delegate)

यह एक ExecutorService बनाता है, जो दिए गए डेलिगेट एक्ज़ीक्यूटर को डेलिगेट करता है.

ध्यान दें कि टास्क में चालू ट्रेस वही होता है जो एक्ज़ीक्यूटर के तरीके को कॉल करने पर चालू होता है. ऐसा इसलिए किया जाता है, क्योंकि TF, ज़्यादातर ऑब्जेक्ट को इनवोकेशन शुरू करने और ट्रेस अटैच करने से पहले बनाता है.

पैरामीटर
delegate ExecutorService

रिटर्न
TracePropagatingExecutorService

लागू करना

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>>