ICommandScheduler
public
interface
ICommandScheduler
| com.android.tradefed.command.ICommandScheduler |
TradeFederation コマンドを実行するためのスケジューラ。
概要
ネストされたクラス | |
|---|---|
interface |
ICommandScheduler.IScheduledInvocationListener
呼び出しが完了したときの呼び出しイベントのリスナー。 |
パブリック メソッド | |
|---|---|
abstract
Pair<Boolean, Integer>
|
addCommand(String[] args)
スケジューラにコマンドを追加します。 |
abstract
void
|
addCommandFile(String cmdFile,
指定されたファイルからすべてのコマンドをスケジューラに追加します。 |
abstract
void
|
await()
スケジューラが実行を開始するまで待機します。これには、該当する場合は、古い TF からのハンドオーバーが完了するまでの待機も含まれます。 |
abstract
void
|
displayCommandQueue(PrintWriter printWriter)
コマンド実行キューの状態に関する詳細なデバッグ情報を出力します。 |
abstract
void
|
displayCommandsInfo(PrintWriter printWriter, String regex)
現在のコマンドのリストを出力します。 |
abstract
void
|
displayInvocationsInfo(PrintWriter printWriter)
現在の呼び出しのリストを表示します。 |
abstract
void
|
dumpCommandsXml(PrintWriter printWriter, String regex)
すべての現在のコマンドに指定されたすべての |
abstract
long
|
execCommand(IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)
既存の |
abstract
long
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener, String[] args)
コマンドキューに追加せずに、デバイスを直接割り当ててコマンドを実行します。 |
abstract
long
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener, ITestDevice device, String[] args)
すでに割り当てられているデバイスでコマンドを直接実行します。 |
abstract
long
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener,
すでに割り当てられているデバイスでコマンドを直接実行します。 |
abstract
CommandFileWatcher
|
getCommandFileWatcher()
このスケジューラに適した CommandFileWatcher を取得します。 |
abstract
int
|
getExecutingCommandCount()
実行中のコマンドの数を返します。 |
abstract
String
|
getInvocationInfo(int invocationId)
呼び出し ID を指定して、呼び出しに関する情報を返します。 |
abstract
CommandRunner.ExitCode
|
getLastInvocationExitCode()
実行された最後の呼び出しのエラーコードを返します。 |
abstract
Throwable
|
getLastInvocationThrowable()
実行された最後の呼び出しから |
abstract
int
|
getReadyCommandCount()
キュー内の準備完了状態のコマンド数を返します。 |
abstract
boolean
|
isDeviceInInvocationThread(ITestDevice device)
デバイスがアクティブな呼び出しスレッドで使用されている場合は true を返します。 |
abstract
void
|
join()
スケジューラが完了するまで待機します。 |
abstract
void
|
join(long millis)
スケジューラが完了するか、指定された期間(ミリ秒単位)後にタイムアウトするまで待機します。 |
abstract
void
|
removeAllCommands()
スケジューラからすべてのコマンドを削除 |
abstract
void
|
setClearcutClient(ClearcutClient client)
ハーネス データをレポートするようにクライアントを設定する |
default
void
|
setMaxPollTime(long polling)
|
default
void
|
setPrintSchedulingWarning(boolean print)
|
abstract
boolean
|
shouldShutdownOnCmdfileError()
コマンドエラー時にスケジューラをシャットダウンする必要がある場合は true を返します。 |
default
void
|
shutdown()
コマンド スケジューラを正常にシャットダウンしようとします。 |
abstract
void
|
shutdown(boolean notifyStop)
コマンド スケジューラを正常にシャットダウンしようとします。 |
abstract
void
|
shutdownHard(boolean killAdb)
コマンド スケジューラを強制的にシャットダウンしようとします。 |
abstract
void
|
shutdownHard()
コマンド スケジューラを強制的にシャットダウンしようとします。 |
abstract
void
|
shutdownOnEmpty()
|
abstract
void
|
start()
|
abstract
boolean
|
stopInvocation(int invocationId, String cause)
実行中の呼び出しを停止するには、その ID を指定します。 |
default
boolean
|
stopInvocation(int invocationId)
実行中の呼び出しを停止するには、その ID を指定します。 |
abstract
boolean
|
stopInvocation(ITestInvocation invocation)
実行中の呼び出しを停止します。 |
default
void
|
stopScheduling()
新しいテストのスケジュール設定と受け入れを停止しますが、Tradefed は停止しません。 |
パブリック メソッド
addCommand
public abstract Pair<Boolean, Integer> addCommand (String[] args)
スケジューラにコマンドを追加します。
コマンドは、実行する構成のインスタンスと、それに関連付けられた引数です。
「--help」引数が指定されている場合、構成のヘルプテキストが stdout に出力されます。それ以外の場合は、構成が実行キューに追加されます。
| パラメータ | |
|---|---|
args |
String: 構成引数。 |
| 戻り値 | |
|---|---|
Pair<Boolean, Integer> |
値のペア。最初の値は、コマンドが正常に追加された場合はブール値 true です。2 番目の値は、コマンドが正常に追加された場合の既知のコマンド トラッカー ID(負でない値)です。コマンドがすべてのデバイスに追加された場合は 0 を返し、それ以外の場合は -1 を返します。 |
| 例外 | |
|---|---|
ConfigurationException |
コマンドを解析できなかった場合 |
addCommandFile
public abstract void addCommandFile (String cmdFile,
extraArgs) 指定されたファイルからすべてのコマンドをスケジューラに追加します
| パラメータ | |
|---|---|
cmdFile |
String: コマンド ファイルのファイル システム パス |
extraArgs |
: ファイルから解析された各コマンドに追加する String 引数の ERROR(/List)。空にすることはできますが、null にすることはできません。 |
| 例外 | |
|---|---|
ConfigurationException |
コマンド ファイルを解析できなかった場合 |
関連項目:
await
public abstract void await ()
スケジューラが実行を開始するまで待機します。古い TF からのハンドオーバーが完了するまで待機する場合もあります。
displayCommandQueue
public abstract void displayCommandQueue (PrintWriter printWriter)
コマンド実行キューの状態に関する詳細なデバッグ情報を出力します。
displayCommandsInfo
public abstract void displayCommandsInfo (PrintWriter printWriter,
String regex)現在のコマンドのリストを出力します。
| パラメータ | |
|---|---|
printWriter |
PrintWriter: 出力先の ERROR(/PrintWriter)。 |
regex |
String: コマンドが一致して出力される正規表現。null の場合、すべてのコマンドが出力されます。 |
displayInvocationsInfo
public abstract void displayInvocationsInfo (PrintWriter printWriter)
現在の呼び出しのリストを表示します。
| パラメータ | |
|---|---|
printWriter |
PrintWriter: 出力先の ERROR(/PrintWriter)。 |
dumpCommandsXml
public abstract void dumpCommandsXml (PrintWriter printWriter,
String regex)現在のすべてのコマンドに指定されたすべての Option 値を含むコマンドの展開された XML ファイルをダンプします。
| パラメータ | |
|---|---|
printWriter |
PrintWriter: ステータスの出力先となる ERROR(/PrintWriter)。 |
regex |
String: xml ファイルをダンプするためにコマンドが一致する必要がある正規表現。null の場合、すべてのコマンドがダンプされます。 |
execCommand
public abstract long execCommand (IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)
既存の IInvocationContext を使用して、コマンドキューに追加せずにデバイスを直接割り当ててコマンドを実行します。
| パラメータ | |
|---|---|
context |
IInvocationContext: 既存の IInvocationContext。 |
listener |
ICommandScheduler.IScheduledInvocationListener: 通知する ICommandScheduler.IScheduledInvocationListener |
args |
String: コマンド引数 |
| 戻り値 | |
|---|---|
long |
|
| 例外 | |
|---|---|
ConfigurationException |
コマンドが無効な場合 |
NoDeviceException |
使用するデバイスがない場合 |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, String[] args)
デバイスを直接割り当て、コマンドキューに追加せずにコマンドを実行します。
| パラメータ | |
|---|---|
listener |
ICommandScheduler.IScheduledInvocationListener: 通知する ICommandScheduler.IScheduledInvocationListener |
args |
String: コマンド引数 |
| 戻り値 | |
|---|---|
long |
スケジュール設定されたコマンドの呼び出し ID。 |
| 例外 | |
|---|---|
ConfigurationException |
コマンドが無効な場合 |
NoDeviceException |
使用するデバイスがない場合 |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, ITestDevice device, String[] args)
すでに割り当てられているデバイスでコマンドを直接実行します。
| パラメータ | |
|---|---|
listener |
ICommandScheduler.IScheduledInvocationListener: 通知する ICommandScheduler.IScheduledInvocationListener |
device |
ITestDevice: 使用する ITestDevice |
args |
String: コマンド引数 |
| 戻り値 | |
|---|---|
long |
スケジュール設定されたコマンドの呼び出し ID。 |
| 例外 | |
|---|---|
ConfigurationException |
コマンドが無効な場合 |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener,devices, String[] args)
すでに割り当てられているデバイスでコマンドを直接実行します。
| パラメータ | |
|---|---|
listener |
ICommandScheduler.IScheduledInvocationListener: 通知する ICommandScheduler.IScheduledInvocationListener |
devices |
: 使用する ERROR(/List |
args |
String: コマンド引数 |
| 戻り値 | |
|---|---|
long |
スケジュール設定されたコマンドの呼び出し ID。 |
| 例外 | |
|---|---|
ConfigurationException |
コマンドが無効な場合 |
getCommandFileWatcher
public abstract CommandFileWatcher getCommandFileWatcher ()
このスケジューラに適した CommandFileWatcher を取得します
| 戻り値 | |
|---|---|
CommandFileWatcher |
|
getExecutingCommandCount
public abstract int getExecutingCommandCount ()
実行中の状態のコマンド数を返します。
| 戻り値 | |
|---|---|
int |
|
getInvocationInfo
public abstract String getInvocationInfo (int invocationId)
呼び出し ID を指定して、呼び出しに関する情報を返します。
| パラメータ | |
|---|---|
invocationId |
int: 呼び出しのトラッキング ID。 |
| 戻り値 | |
|---|---|
String |
呼び出しに関する情報を含む String。 |
getLastInvocationExitCode
public abstract CommandRunner.ExitCode getLastInvocationExitCode ()
実行された最後の呼び出しのエラーコードを返します。呼び出しがまだ実行されていない場合は、0(エラーなし)を返します。
| 戻り値 | |
|---|---|
CommandRunner.ExitCode |
|
getLastInvocationThrowable
public abstract Throwable getLastInvocationThrowable ()
実行された最後の呼び出しから Throwable を返します。スロー可能なものがない場合は null を返します。
| 戻り値 | |
|---|---|
Throwable |
|
getReadyCommandCount
public abstract int getReadyCommandCount ()
キュー内の準備完了状態のコマンド数を返します。
| 戻り値 | |
|---|---|
int |
|
isDeviceInInvocationThread
public abstract boolean isDeviceInInvocationThread (ITestDevice device)
デバイスがアクティブな呼び出しスレッドで使用されている場合は true を返します。
| パラメータ | |
|---|---|
device |
ITestDevice |
| 戻り値 | |
|---|---|
boolean |
|
join
public abstract void join (long millis)
スケジューラが完了するか、指定された期間(ミリ秒単位)後にタイムアウトするまで待機します。
| パラメータ | |
|---|---|
millis |
long |
関連項目:
removeAllCommands
public abstract void removeAllCommands ()
スケジューラからすべてのコマンドを削除
setClearcutClient
public abstract void setClearcutClient (ClearcutClient client)
ハーネスデータを報告するようにクライアントを設定する
| パラメータ | |
|---|---|
client |
ClearcutClient |
setMaxPollTime
public void setMaxPollTime (long polling)
| パラメータ | |
|---|---|
polling |
long |
setPrintSchedulingWarning
public void setPrintSchedulingWarning (boolean print)
| パラメータ | |
|---|---|
print |
boolean |
shouldShutdownOnCmdfileError
public abstract boolean shouldShutdownOnCmdfileError ()
コマンドエラー時にスケジューラをシャットダウンする必要がある場合は true を返します
| 戻り値 | |
|---|---|
boolean |
|
shutdown
public void shutdown ()
コマンド スケジューラを正常にシャットダウンしようとします。
テストを待機しているコマンドをクリアし、進行中のすべての呼び出しを正常にシャットダウンするようリクエストします。
シャットダウンが呼び出されると、スケジューラ メインループは、進行中のすべての呼び出しが完了するまで待機してから完全に終了します。
shutdown
public abstract void shutdown (boolean notifyStop)
コマンド スケジューラを正常にシャットダウンしようとします。
| パラメータ | |
|---|---|
notifyStop |
boolean: true の場合、TF シャットダウンの呼び出しに通知します。 |
shutdownHard
public abstract void shutdownHard (boolean killAdb)
コマンド スケジューラを強制的にシャットダウンしようとします。
shutdown() と同様ですが、必要に応じて adb 接続を強制終了し、進行中の呼び出しをより早く完了させようとします。
| パラメータ | |
|---|---|
killAdb |
boolean |
shutdownHard
public abstract void shutdownHard ()
コマンド スケジューラを強制的にシャットダウンしようとします。shutdownHard(true) と同じ。
shutdownOnEmpty
public abstract void shutdownOnEmpty ()
shutdown() と似ていますが、終了する前にすべてのコマンドが実行されるのを待ちます。
コマンドがループモードの場合、スケジューラは終了しません。
start
public abstract void start ()
ICommandScheduler を開始します。
他のメソッドを呼び出す前に呼び出す必要があります。
shutdown() が呼び出されるまで実行されます。Thread.start() をご覧ください。
stopInvocation
public abstract boolean stopInvocation (int invocationId,
String cause)実行中の呼び出しを停止するには、その ID を指定します。
| パラメータ | |
|---|---|
invocationId |
int: 呼び出しのトラッキング ID。 |
cause |
String: 呼び出しを停止する原因。 |
| 戻り値 | |
|---|---|
boolean |
呼び出しが停止した場合は true、それ以外の場合は false |
| 例外 | |
|---|---|
UnsupportedOperationException |
実装がこれをサポートしていない場合 |
stopInvocation
public boolean stopInvocation (int invocationId)
実行中の呼び出しを停止するには、その ID を指定します。
| パラメータ | |
|---|---|
invocationId |
int |
| 戻り値 | |
|---|---|
boolean |
呼び出しが停止した場合は true、それ以外の場合は false |
| 例外 | |
|---|---|
UnsupportedOperationException |
実装がこれをサポートしていない場合 |
stopInvocation
public abstract boolean stopInvocation (ITestInvocation invocation)
実行中の呼び出しを停止します。
| パラメータ | |
|---|---|
invocation |
ITestInvocation |
| 戻り値 | |
|---|---|
boolean |
呼び出しが停止した場合は true、それ以外の場合は false |
| 例外 | |
|---|---|
UnsupportedOperationException |
実装がこれをサポートしていない場合 |
stopScheduling
public void stopScheduling ()
新しいテストのスケジュール設定と受け入れを停止しますが、Tradefed は停止しません。これは、実行中のテストをすべてドレインしてから Tradefed プロセスを終了する 2 段階のシャットダウンを可能にするためのものです。