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>

ITestDevice でシェルコマンドの実行の詳細をラップする ERROR(/Callable)。 

パブリック メソッド

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

task で現在のスレッドに参加するための便利なメソッド。

実行中に発生した DeviceNotAvailableExceptionERROR(/TimeoutException) は透過的に渡されます。それ以外はエラーとしてログに記録されますが、それ以外では処理されません。

パブリック メソッド

joinFuture

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