CommandInterrupter
public
class
CommandInterrupter
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.command.CommandInterrupter |
TradeFederation コマンドの中断または中断不可としてのマーク付けを許可するサービス。
概要
フィールド | |
|---|---|
public
static
final
CommandInterrupter |
INSTANCE
Singleton。 |
パブリック コンストラクタ | |
|---|---|
CommandInterrupter()
|
|
パブリック メソッド | |
|---|---|
void
|
allowInterrupt()
現在のスレッドの中断を許可します。 |
Future<?>
|
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()
|
フィールド
パブリック コンストラクタ
CommandInterrupter
public CommandInterrupter ()
パブリック メソッド
allowInterrupt
public void allowInterrupt ()
現在のスレッドの中断を許可します。
allowInterruptAsync
public Future<?> allowInterruptAsync (Thread thread,
long delay,
TimeUnit unit)指定されたスレッドが遅延後に割り込み可能になるようにします。
| パラメータ | |
|---|---|
thread |
Thread: 割り込み可能としてマークするスレッド |
delay |
long: 実行を遅延させる時間(現在から) |
unit |
TimeUnit: 遅延パラメータの時間単位 |
| 戻り値 | |
|---|---|
Future<?> |
|
blockInterrupt
public void blockInterrupt ()
現在のスレッドが中断されないようにします。
checkInterrupted
public void checkInterrupted ()
中断する必要がある場合は、現在のスレッドを中断します。スレッドは、適切な RunInterruptedException をスローするために、このメソッドを定期的に呼び出すことが推奨されます。
| 例外 | |
|---|---|
RunInterruptedException |
|
割り込む
public void interrupt (Thread thread,
String message,
ErrorIdentifier errorId)スレッドにフラグを設定し、割り込み可能になったら割り込みます。
| パラメータ | |
|---|---|
thread |
Thread: 中断対象としてマークするスレッド |
message |
String: 中断メッセージ |
errorId |
ErrorIdentifier |
isInterruptible
public boolean isInterruptible (Thread thread)
| パラメータ | |
|---|---|
thread |
Thread |
| 戻り値 | |
|---|---|
boolean |
指定されたスレッドが割り込み可能である場合は true |
isInterruptible
public boolean isInterruptible ()
| 戻り値 | |
|---|---|
boolean |
現在のスレッドが割り込み可能である場合は true |