CommandInterrupter

public class CommandInterrupter
extends Object

java.lang.Object
com.android.tradefed.command.CommandInterrupter


Servizio che consente di interrompere o contrassegnare come non interrompibili i comandi della TradeFederation.

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)

Consentire l'interruzione di un thread specificato 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)

Contrassegnare un thread, interrompendolo se e quando diventa interrompibile.

boolean isInterruptible (Thread thread)
boolean isInterruptible ()

Campi

ESEMPIO

public static final CommandInterrupter INSTANCE

Singleton.

Costruttori pubblici

CommandInterrupter

public CommandInterrupter ()

Metodi pubblici

consentireInterrupt

public void allowInterrupt ()

Consenti l'interruzione del thread corrente.

consentireInterruptAsync

public  allowInterruptAsync (Thread thread, 
                long delay, 
                TimeUnit unit)

Consentire l'interruzione di un thread specificato dopo un ritardo.

Parametri
thread Thread : thread da contrassegnare come interrompibile

delay long : tempo da adesso per ritardare l'esecuzione

unit TimeUnit : unità di tempo del parametro di ritardo

ritorna

bloccoInterrupt

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 lanciare la corretta RunInterruptedException .

Lancia
RunInterruptedException

interrompere

public void interrupt (Thread thread, 
                String message, 
                ErrorIdentifier errorId)

Contrassegnare un thread, interrompendolo se e quando diventa interrompibile.

Parametri
thread Thread : filo 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