CommandeInterrupteur
public class CommandInterrupter
extends Object
java.lang.Object | |
↳ | com.android.tradefed.command.CommandInterrupter |
Service permettant d'interrompre ou de marquer les commandes TradeFederation comme ininterruptibles.
Résumé
Des champs | |
---|---|
public static final CommandInterrupter | INSTANCE Singleton. |
Constructeurs publics | |
---|---|
CommandInterrupter () |
Méthodes publiques | |
---|---|
void | allowInterrupt () Autoriser l'interruption du thread en cours. |
allowInterruptAsync (Thread thread, long delay, TimeUnit unit) Autoriser un thread spécifié à être interrompu après un délai. | |
void | blockInterrupt () Empêcher le thread actuel d'être interrompu. |
void | checkInterrupted () Interrompt le thread en cours s'il doit être interrompu. |
void | interrupt (Thread thread, String message, ErrorIdentifier errorId) Marquez un thread, en l'interrompant si et quand il devient interruptible. |
boolean | isInterruptible (Thread thread) |
boolean | isInterruptible () |
Des champs
Constructeurs publics
CommandeInterrupteur
public CommandInterrupter ()
Méthodes publiques
autoriser l'interruption
public void allowInterrupt ()
Autoriser l'interruption du thread en cours.
AllowInterruptAsync
publicallowInterruptAsync (Thread thread, long delay, TimeUnit unit)
Autoriser un thread spécifié à être interrompu après un délai.
Paramètres | |
---|---|
thread | Thread : fil à marquer comme interruption |
delay | long : délai à partir de maintenant pour retarder l'exécution |
unit | TimeUnit : unité de temps du paramètre delay |
Retour | |
---|---|
bloquerInterruption
public void blockInterrupt ()
Empêcher le thread actuel d'être interrompu.
checkInterrompu
public void checkInterrupted ()
Interrompt le thread en cours s'il doit être interrompu. Les threads sont encouragés à appeler périodiquement cette méthode afin de lancer la bonne RunInterruptedException
.
Jetés | |
---|---|
RunInterruptedException |
interrompre
public void interrupt (Thread thread, String message, ErrorIdentifier errorId)
Marquez un thread, en l'interrompant si et quand il devient interruptible.
Paramètres | |
---|---|
thread | Thread : fil à marquer pour interruption |
message | String : message d'interruption |
errorId | ErrorIdentifier |
estInterruptible
public boolean isInterruptible (Thread thread)
Paramètres | |
---|---|
thread | Thread |
Retour | |
---|---|
boolean | vrai si le thread spécifié est interruptible |
estInterruptible
public boolean isInterruptible ()
Retour | |
---|---|
boolean | vrai si le thread actuel est interrompu |