コマンドインタラプタ
public class CommandInterrupter
extends Object
java.lang.オブジェクト | |
↳ | com.android.tradefed.command.CommandInterrupter |
TradeFederation コマンドを中断したり、中断不可能としてマークしたりできるサービス。
まとめ
田畑 | |
---|---|
public static final CommandInterrupter | INSTANCE シングルトン。 |
パブリックコンストラクター | |
---|---|
CommandInterrupter () |
パブリックメソッド | |
---|---|
void | allowInterrupt () 現在のスレッドの中断を許可します。 |
allowInterruptAsync (Thread thread, long delay, TimeUnit unit) 指定したスレッドを遅延後に中断できるようにします。 | |
void | blockInterrupt () 現在のスレッドが中断されないようにします。 |
void | checkInterrupted () 現在のスレッドを中断する必要がある場合は中断します。 |
void | interrupt (Thread thread, String message, ErrorIdentifier errorId) スレッドにフラグを立てて、割り込み可能になった場合にスレッドを中断します。 |
boolean | isInterruptible (Thread thread) |
boolean | isInterruptible () |
田畑
パブリックコンストラクター
コマンドインタラプタ
public CommandInterrupter ()
パブリックメソッド
割り込みを許可する
public void allowInterrupt ()
現在のスレッドの中断を許可します。
割り込み非同期を許可する
publicallowInterruptAsync (Thread thread, long delay, TimeUnit unit)
指定したスレッドを遅延後に中断できるようにします。
パラメーター | |
---|---|
thread | Thread : 割り込み可能としてマークするスレッド |
delay | long : 今から実行を遅らせるまでの時間 |
unit | TimeUnit : 遅延パラメータの時間単位 |
戻り値 | |
---|---|
ブロック割り込み
public void blockInterrupt ()
現在のスレッドが中断されないようにします。
チェック中断
public void checkInterrupted ()
現在のスレッドを中断する必要がある場合は中断します。スレッドは、適切なRunInterruptedException
をスローするために、このメソッドを定期的に呼び出すことをお勧めします。
投げる | |
---|---|
RunInterruptedException |
割り込み
public void interrupt (Thread thread, String message, ErrorIdentifier errorId)
スレッドにフラグを立てて、割り込み可能になった場合にスレッドを中断します。
パラメーター | |
---|---|
thread | Thread : 中断のマークを付けるスレッド |
message | String : 中断メッセージ |
errorId | ErrorIdentifier |
中断可能です
public boolean isInterruptible (Thread thread)
パラメーター | |
---|---|
thread | Thread |
戻り値 | |
---|---|
boolean | 指定されたスレッドが割り込み可能な場合は true |
中断可能です
public boolean isInterruptible ()
戻り値 | |
---|---|
boolean | 現在のスレッドが割り込み可能な場合は true |