CommandInterrupter
public
class
CommandInterrupter
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.command.CommandInterrupter |
שירות שמאפשר להפריע לפקודות TradeFederation או לסמן אותן כפקודות שלא ניתן להפריע להן.
סיכום
שדות | |
|---|---|
public
static
final
CommandInterrupter |
INSTANCE
Singleton. |
constructors ציבוריים | |
|---|---|
CommandInterrupter()
|
|
methods ציבוריים | |
|---|---|
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()
|
שדות
constructors ציבוריים
CommandInterrupter
public CommandInterrupter ()
methods ציבוריים
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 הנכון.
| הקפצת הודעות שגיאה (throw) | |
|---|---|
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 אם אפשר להפריע לשרשור הנוכחי |