設備並發實用程式

public class DeviceConcurrentUtil
extends Object

java.lang.Object
com.android.tradefed.util.DeviceConcurrentUtil


包含用於並發設備端命令執行的實用方法和類

使用ERROR(/ExecutorService)執行作為ShellCommandCallable實作的命令,並使用ERROR(/#joinFuture(String,Future,long))ERROR(/ExecutorService)傳回的ERROR(/Future)同步執行指令。

概括

嵌套類

class DeviceConcurrentUtil.ShellCommandCallable <V>

一個ERROR(/Callable) ,包含在ITestDevice上執行 shell 指令的詳細資訊。

公共方法

static <T> T joinFuture (String taskDesc, task, long timeout) joinFuture (String taskDesc, task, long timeout)

將目前執行緒加入task的便捷方法

執行期間發生的DeviceNotAvailableExceptionERROR(/TimeoutException)會被透明地傳遞,其他的會被記錄為錯誤但不會進行其他處理。

公共方法

加入未來

public static T joinFuture (String taskDesc, 
                 task, 
                long timeout)

將目前執行緒加入task的便捷方法

執行期間發生的DeviceNotAvailableExceptionERROR(/TimeoutException)會被透明地傳遞,其他的會被記錄為錯誤但不會進行其他處理。

參數
taskDesc String :用於記錄目的的任務描述

task : ERROR(/Future)代表要加入的任務

timeout long : 等待任務逾時

退貨
T具有範本類型的任務的結果。

投擲
com.android.tradefed.device.DeviceNotAvailableException
逾時異常
DeviceNotAvailableException