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