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, extraArgs) addCommandFile (String cmdFile, extraArgs)

指定されたファイルのすべてのコマンドをスケジューラに追加します

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)

現在のすべてのコマンドに指定されたすべてのOption値を使用して、コマンドの展開された xml ファイルをダンプします。

abstract long execCommand ( IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)

デバイスを直接割り当てて、既存のIInvocationContextを使用してコマンド キューに追加せずにコマンドを実行します。

abstract long execCommand ( ICommandScheduler.IScheduledInvocationListener listener, String[] args)

コマンドキューに追加せずに、デバイスを直接割り当ててコマンドを実行します。

abstract long execCommand ( ICommandScheduler.IScheduledInvocationListener listener, devices, String[] args) execCommand ( ICommandScheduler.IScheduledInvocationListener listener, devices, String[] args)

すでに割り当てられているデバイスでコマンドを直接実行します。

abstract CommandFileWatcher getCommandFileWatcher ()

このスケジューラの適切なCommandFileWatcherを取得します

abstract int getExecutingCommandCount ()

実行中のコマンドの数を返します。

abstract String getInvocationInfo (int invocationId)

呼び出し ID を指定して呼び出し bu に関する情報を返します。

abstract CommandRunner.ExitCode getLastInvocationExitCode ()

実行された最後の呼び出しのエラー コードを返します。

abstract Throwable getLastInvocationThrowable ()

実行された最後の呼び出しからERROR(/Throwable)を返します。

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)

ハーネス データをレポートするようにクライアントを設定する

abstract boolean shouldShutdownOnCmdfileError ()

コマンド エラーでスケジューラをシャットダウンする必要がある場合は true を返します

default void shutdown ()

コマンド スケジューラの正常なシャットダウンを試みます。

abstract void shutdown (boolean notifyStop)

コマンド スケジューラの正常なシャットダウンを試みます。

abstract void shutdownHard (boolean killAdb)

コマンド スケジューラの強制シャットダウンを試みます。

abstract void shutdownHard ()

コマンド スケジューラの強制シャットダウンを試みます。

abstract void shutdownOnEmpty ()

shutdown()と似ていますが、終了する前にすべてのコマンドが実行されるのを待ちます。

abstract void start ()

ICommandSchedulerを開始します。

abstract boolean stopInvocation (int invocationId, String cause)

ID を指定して、実行中の呼び出しを停止します。

default boolean stopInvocation (int invocationId)

ID を指定して、実行中の呼び出しを停止します。

abstract boolean stopInvocation ( ITestInvocation invocation)

実行中の呼び出しを停止します。

公開メソッド

add コマンド

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 : ファイルから解析された各コマンドに追加するERROR(/String)引数のERROR(/List) 。空にすることはできますが、null にすることはできません。

スロー
ConfigurationExceptionコマンドファイルを解析できなかった場合

以下も参照してください。

待つ

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 の場合、すべてのコマンドがダンプされます。

exec コマンド

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使用するデバイスがない場合

exec コマンド

public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, 
                String[] args)

コマンドキューに追加せずに、デバイスを直接割り当ててコマンドを実行します。

パラメーター
listener ICommandScheduler.IScheduledInvocationListener : 通知されるICommandScheduler.IScheduledInvocationListener

args String : コマンド引数

戻り値
longスケジュールされたコマンドの呼び出し ID。

スロー
ConfigurationExceptionコマンドが無効だった場合
NoDeviceException使用するデバイスがない場合

exec コマンド

public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, 
                 devices, 
                String[] args)

すでに割り当てられているデバイスでコマンドを直接実行します。

パラメーター
listener ICommandScheduler.IScheduledInvocationListener : 通知されるICommandScheduler.IScheduledInvocationListener

devices : ERROR(/List ) 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 を指定して呼び出し bu に関する情報を返します。

パラメーター
invocationId int : 呼び出しの追跡 ID。

戻り値
String呼び出しに関する情報を含むERROR(/String)

getLastInvocationExitCode

public abstract CommandRunner.ExitCode getLastInvocationExitCode ()

実行された最後の呼び出しのエラー コードを返します。呼び出しがまだ実行されていない場合は、0 (エラーなし) を返します。

戻り値
CommandRunner.ExitCode

getLastInvocationThrowable

public abstract Throwable getLastInvocationThrowable ()

実行された最後の呼び出しからERROR(/Throwable)を返します。スロー可能なものがない場合は、null を返します。

戻り値
Throwable

getReadyCommandCount

public abstract int getReadyCommandCount ()

キュー内の準備完了状態のコマンドの数を返します。

戻り値
int

isDeviceInInvocationThread

public abstract boolean isDeviceInInvocationThread (ITestDevice device)

デバイスがアクティブな呼び出しスレッドによって使用されている場合は true を返します。

パラメーター
device ITestDevice

戻り値
boolean

加入

public abstract void join ()

スケジューラーが完了するのを待ちます。

以下も参照してください。

加入

public abstract void join (long millis)

スケジューラが完了するまで待機するか、ミリ秒単位で指定された期間が経過するとタイムアウトします。

パラメーター
millis long

以下も参照してください。

removeAllCommands

public abstract void removeAllCommands ()

スケジューラからすべてのコマンドを削除します

setClearcutClient

public abstract void setClearcutClient (ClearcutClient client)

ハーネス データをレポートするようにクライアントを設定する

パラメーター
client ClearcutClient

shouldShutdownOnCmdfileError

public abstract boolean shouldShutdownOnCmdfileError ()

コマンド エラーでスケジューラをシャットダウンする必要がある場合は true を返します

戻り値
boolean

シャットダウン

public void shutdown ()

コマンド スケジューラの正常なシャットダウンを試みます。

テストを待っているコマンドをクリアし、進行中のすべての呼び出しを正常にシャットダウンするように要求します。

shutdown が呼び出された後、スケジューラのメイン ループは、進行中のすべての呼び出しが完了するまで待機してから、完全に終了します。

シャットダウン

public abstract void shutdown (boolean notifyStop)

コマンド スケジューラの正常なシャットダウンを試みます。

パラメーター
notifyStop boolean : true の場合、TF シャットダウンの呼び出しを通知します。

シャットダウンハード

public abstract void shutdownHard (boolean killAdb)

コマンド スケジューラの強制シャットダウンを試みます。

shutdown()に似ていますが、オプションで adb 接続を強制終了し、進行中の呼び出しを「刺激」してより迅速に完了させようとします。

パラメーター
killAdb boolean

シャットダウンハード

public abstract void shutdownHard ()

コマンド スケジューラの強制シャットダウンを試みます。 shutdownHard(true) と同じです。

shutdownOnEmpty

public abstract void shutdownOnEmpty ()

shutdown()と似ていますが、終了する前にすべてのコマンドが実行されるのを待ちます。

コマンドがループ モードの場合、スケジューラは終了しないことに注意してください。

始める

public abstract void start ()

ICommandSchedulerを開始します。

他のメソッドを呼び出す前に呼び出す必要があります。

shutdown()が呼び出されるまで実行されます。 ERROR(/Thread#start())を参照してください。

stopInvocation

public abstract boolean stopInvocation (int invocationId, 
                String cause)

ID を指定して、実行中の呼び出しを停止します。

パラメーター
invocationId int : 呼び出しの追跡 ID。

cause String : 呼び出しを停止する原因。

戻り値
boolean呼び出しが停止された場合は true、そうでない場合は false

スロー
実装がこれをサポートしていない場合

stopInvocation

public boolean stopInvocation (int invocationId)

ID を指定して、実行中の呼び出しを停止します。

パラメーター
invocationId int

戻り値
boolean呼び出しが停止された場合は true、そうでない場合は false

スロー
実装がこれをサポートしていない場合

stopInvocation

public abstract boolean stopInvocation (ITestInvocation invocation)

実行中の呼び出しを停止します。

パラメーター
invocation ITestInvocation

戻り値
boolean呼び出しが停止された場合は true、そうでない場合は false

スロー
実装がこれをサポートしていない場合