CommandInterrupter

public class CommandInterrupter
extends Object

java.lang.Oggetto
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)

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)

Contrassegna 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 delay

ritorna

blockInterrupt

public void blockInterrupt ()

Impedisce l'interruzione del thread corrente.

checkInterrupted

public void checkInterrupted ()

Interrompe il thread corrente se deve essere interrotto. I thread sono incoraggiati a chiamare periodicamente questo metodo per lanciare l' RunInterruptedException corretta.

Getta
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