CommandInterrupter
public class CommandInterrupter
extends Object
java.lang.Object | |
↳ | com.android.tradefed.command.CommandInterrupter |
Service permettant d'interrompre ou de marquer les commandes TradeFederation comme non interruptibles.
Résumé
Des champs | |
---|---|
public static final CommandInterrupter | INSTANCE Singleton. |
Constructeurs publics | |
---|---|
CommandInterrupter () |
Méthodes publiques | |
---|---|
void | allowInterrupt () Autoriser l'interruption du fil en cours. |
allowInterruptAsync (Thread thread, long delay, TimeUnit unit) Autoriser l'interruption d'un thread spécifié après un certain délai. | |
void | blockInterrupt () Empêcher le thread en cours d'être interrompu. |
void | checkInterrupted () Interrompt le thread en cours s'il doit être interrompu. |
void | interrupt (Thread thread, String message, ErrorIdentifier errorId) Marquer un thread, l'interrompre si et quand il devient interruptible. |
boolean | isInterruptible (Thread thread) |
boolean | isInterruptible () |
Des champs
Constructeurs publics
CommandInterrupter
public CommandInterrupter ()
Méthodes publiques
autoriserl'interruption
public void allowInterrupt ()
Autoriser l'interruption du fil en cours.
allowInterruptAsync
publicallowInterruptAsync (Thread thread, long delay, TimeUnit unit)
Autoriser l'interruption d'un thread spécifié après un certain délai.
Paramètres | |
---|---|
thread | Thread : thread à marquer comme interruptible |
delay | long : temps à partir de maintenant pour retarder l'exécution |
unit | TimeUnit : unité de temps du paramètre delay |
Retour | |
---|---|
blockInterrupt
public void blockInterrupt ()
Empêcher le thread en cours d'être interrompu.
checkInterrupted
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
.
Lance | |
---|---|
RunInterruptedException |
interrompre
public void interrupt (Thread thread, String message, ErrorIdentifier errorId)
Marquer un thread, l'interrompre si et quand il devient interruptible.
Paramètres | |
---|---|
thread | Thread : fil à marquer pour interruption |
message | String : message d'interruption |
errorId | ErrorIdentifier |
est Interruptible
public boolean isInterruptible (Thread thread)
Paramètres | |
---|---|
thread | Thread |
Retour | |
---|---|
boolean | vrai si le thread spécifié est interruptible |
est Interruptible
public boolean isInterruptible ()
Retour | |
---|---|
boolean | vrai si le thread actuel est interruptible |