ICommandScheduler

public interface ICommandScheduler

com.android.tradefed.command.ICommandScheduler


TradeFederation コマンドを実行するスケジューラ。

概要

ネストされたクラス

interface ICommandScheduler.IScheduledInvocationListener

呼び出しが完了したときのイベントのリスナー。 

パブリック メソッド

abstract boolean addCommand(String[] args)

スケジューラにコマンドを追加します。

abstract void addCommandFile(String cmdFile, extraArgs)

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

abstract void await()

スケジューラが実行を開始するまで待機します。これには、該当する場合は古い TF からの引き継ぎが完了するまで待機することも含まれます。

abstract void completeHandover()

開始された引き継ぎシーケンスが完全に完了し、デフォルト ポートでリモート マネージャーを再初期化する必要があることを指示します。

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 void execCommand(IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)

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

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

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

abstract void execCommand(ICommandScheduler.IScheduledInvocationListener listener, ITestDevice device, String[] args)

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

abstract CommandFileWatcher getCommandFileWatcher()

このスケジューラに適した CommandFileWatcher を取得します。

abstract int getExecutingCommandCount()

実行状態の Command の数を返します。

abstract String getInvocationInfo(int invocationId)

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

abstract CommandRunner.ExitCode getLastInvocationExitCode()

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

abstract Throwable getLastInvocationThrowable()

最後に実行された呼び出しの Throwable を返します。

abstract int getReadyCommandCount()

キュー内の準備完了状態の Command の数を返します。

abstract void handoverInitiationComplete()

使用中のデバイスとコマンドの最初の引き継ぎ交換が完了し、オペレーションのスケジュールを開始できることをコマンド スケジューラに通知します。

abstract boolean handoverShutdown(int handoverPort)

shutdown() を開始し、同じホスト上の別の TradeFed プロセスに引き渡します。

abstract void join()

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

abstract void join(long millis)

ミリ秒単位で指定された時間後に、スケジューラが完了するかタイムアウトするまで待ちます。

abstract void removeAllCommands()

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

abstract void setClearcutClient(ClearcutClient client)

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

abstract boolean shouldShutdownOnCmdfileError()

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

abstract void shutdown()

コマンド スケジューラを正常にシャットダウンしようとします。

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)

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

パブリック メソッド

addCommand

public abstract boolean addCommand (String[] args)

スケジューラにコマンドを追加します。

コマンドは基本的に、実行する構成とそれに関連付けられた引数のインスタンスです。

「--help」引数を指定すると、構成のヘルプテキストが stdout に出力されます。それ以外の場合は、構成ファイルがキューに追加され、実行されます。

パラメータ
args String: 構成引数。

戻り値
boolean true(コマンドが正常に追加された場合)

例外
ConfigurationException コマンドを解析できなかった場合

addCommandFile

public abstract void addCommandFile (String cmdFile, 
                 extraArgs)

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

パラメータ
cmdFile String: コマンド ファイルのファイル システム パス

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

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

関連項目:

await

public abstract void await ()

スケジューラが実行を開始するまで待機します。これには、該当する場合、古い TF からの引き継ぎが完了するまで待機することも含まれます。

completeHandover

public abstract void completeHandover ()

開始された引き継ぎシーケンスが完全に完了し、デフォルト ポートでリモート マネージャーを再初期化する必要があることを指示します。

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 void execCommand (IInvocationContext context, 
                ICommandScheduler.IScheduledInvocationListener listener, 
                String[] args)

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

パラメータ
context IInvocationContext: 既存の IInvocationContext

listener ICommandScheduler.IScheduledInvocationListener: 通知する ICommandScheduler.IScheduledInvocationListener

args String: コマンドの引数

例外
ConfigurationException コマンドが正しくない場合
NoDeviceException 使用するデバイスがない場合

execCommand

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

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

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

args String: コマンドの引数

例外
ConfigurationException コマンドが正しくない場合
NoDeviceException 使用するデバイスがない場合

execCommand

public abstract void execCommand (ICommandScheduler.IScheduledInvocationListener listener, 
                ITestDevice device, 
                String[] args)

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

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

device ITestDevice: 使用する ITestDevice

args String: コマンドの引数

例外
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 ()

キュー内の準備完了状態の Command の数を返します。

戻り値
int

handoverInitiationComplete

public abstract void handoverInitiationComplete ()

使用中のデバイスとコマンドの最初の引き継ぎ交換が完了し、オペレーションのスケジュールを開始できることをコマンド スケジューラに通知します。

handoverShutdown

public abstract boolean handoverShutdown (int handoverPort)

shutdown() を開始し、同じホスト上の別の TradeFed プロセスに引き渡します。

スケジューラは、解放されたデバイスが利用可能になると、そのポートでリッスンしているリモート tradefed プロセスに通知します。

パラメータ
handoverPort int

戻り値
boolean ハンドオーバーの開始が成功した場合は true、それ以外の場合は false

join

public abstract void join ()

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

関連項目:

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 abstract void shutdown ()

コマンド スケジューラを正常にシャットダウンしようとします。

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

シャットダウンが呼び出されると、スケジューラ メインループは、進行中のすべての呼び出しが完了するまで待ってから完全に終了します。

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 実装でこれがサポートされていない場合