CommandInterrupter

public class CommandInterrupter
extends Object

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


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

Riepilogo

Campi

public static final CommandInterrupter INSTANCE

Singleton.

Costruttori pubblici

CommandInterrupter()

Metodi pubblici

void allowInterrupt()

Consente l'interruzione del thread corrente.

allowInterruptAsync(Thread thread, long delay, TimeUnit unit)

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

void blockInterrupt()

Impedisci 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

ISTANZA

public static final CommandInterrupter INSTANCE

Singleton.

Costruttori pubblici

CommandInterrupter

public CommandInterrupter ()

Metodi pubblici

allowInterrupt

public void allowInterrupt ()

Consente l'interruzione del thread corrente.

allowInterruptAsync

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

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

Parametri
thread Thread: thread da contrassegnare come interrompibile

delay long: tempo da posticipare l'esecuzione

unit TimeUnit: unità di tempo del parametro di ritardo

Ritorni

blockInterrupt

public void blockInterrupt ()

Impedisci l'interruzione del thread corrente.

checkInterrupted

public void checkInterrupted ()

Interrompe il thread corrente se deve essere interrotto. È consigliabile chiamare periodicamente questo metodo per generare l'errore RunInterruptedException corretto.

Lanci
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

Ritorni
boolean true se il thread specificato è interrompibile

isInterruptible

public boolean isInterruptible ()

Ritorni
boolean true se il thread corrente è interrompibile