DeviceConcurrentUtil
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>
用于封装在 |
公共方法 | |
|---|---|
static
<T>
T
|
joinFuture(String taskDesc,
用于在
执行期间发生的 |
公共方法
joinFuture
public static T joinFuture (String taskDesc,
task,
long timeout) 用于在 task 上加入当前线程的便捷方法
执行期间发生的 DeviceNotAvailableException 和 ERROR(/TimeoutException) 会透明地传递,其他错误会记录为错误,但不会以其他方式处理。
| 参数 | |
|---|---|
taskDesc |
String:用于日志记录目的的任务说明 |
task |
:表示要联接的任务的 ERROR(/Future) |
timeout |
long:等待任务的超时 |
| 返回 | |
|---|---|
T |
具有模板类型的任务的结果。 |
| 抛出 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|