CommandInterrupter
public
class
CommandInterrupter
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.command.CommandInterrupter |
Servizio che consente di interrompere i comandi TradeFederation o contrassegnarli come non interrompibili.
Riepilogo
Campi | |
|---|---|
public
static
final
CommandInterrupter |
INSTANCE
Singleton. |
Costruttori pubblici | |
|---|---|
CommandInterrupter()
|
|
Metodi pubblici | |
|---|---|
void
|
allowInterrupt()
Consenti l'interruzione del thread corrente. |
Future<?>
|
allowInterruptAsync(Thread thread, long delay, TimeUnit unit)
Consente di interrompere un thread specificato dopo un ritardo. |
void
|
blockInterrupt()
Impedire l'interruzione del thread corrente. |
void
|
checkInterrupted()
Interrompe il thread corrente, se deve essere interrotto. |
void
|
interrupt(Thread thread, String message, ErrorIdentifier errorId)
Segnala un thread, interrompendolo se e quando diventa interrompibile. |
boolean
|
isInterruptible(Thread thread)
|
boolean
|
isInterruptible()
|
Campi
Costruttori pubblici
CommandInterrupter
public CommandInterrupter ()
Metodi pubblici
allowInterrupt
public void allowInterrupt ()
Consenti l'interruzione del thread corrente.
allowInterruptAsync
public Future<?> allowInterruptAsync (Thread thread,
long delay,
TimeUnit unit)Consente di interrompere un thread specificato dopo un ritardo.
| Parametri | |
|---|---|
thread |
Thread: thread da contrassegnare come interrompibile |
delay |
long: tempo da ora per ritardare l'esecuzione |
unit |
TimeUnit: unità di tempo del parametro di ritardo |
| Resi | |
|---|---|
Future<?> |
|
blockInterrupt
public void blockInterrupt ()
Impedire l'interruzione del thread corrente.
checkInterrupted
public void checkInterrupted ()
Interrompe il thread corrente, se deve essere interrotto. I thread sono invitati a
chiamare periodicamente questo metodo per generare l'RunInterruptedException corretto.
| Genera | |
|---|---|
RunInterruptedException |
|
interrompere
public void interrupt (Thread thread,
String message,
ErrorIdentifier errorId)Segnala un thread, interrompendolo se e quando diventa interrompibile.
| Parametri | |
|---|---|
thread |
Thread: thread da contrassegnare per l'interruzione |
message |
String: messaggio di interruzione |
errorId |
ErrorIdentifier |
isInterruptible
public boolean isInterruptible (Thread thread)
| Parametri | |
|---|---|
thread |
Thread |
| Resi | |
|---|---|
boolean |
true se il thread specificato è interrompibile |
isInterruptible
public boolean isInterruptible ()
| Resi | |
|---|---|
boolean |
true se il thread corrente è interrompibile |