ICommandScheduler
public interface ICommandScheduler
com.android.tradefed.command.ICommandScheduler |
Un planificateur pour exécuter les commandes TradeFederation.
Résumé
Classes imbriquées | |
---|---|
interface | ICommandScheduler.IScheduledInvocationListener Écouteur pour les événements d'appel lorsque l'appel est terminé. |
Méthodes publiques | |
---|---|
abstract Pair <Boolean, Integer> | addCommand (String[] args) Ajoute une commande au planificateur. |
abstract void | addCommandFile (String cmdFile, extraArgs) addCommandFile (String cmdFile, extraArgs) Ajoute toutes les commandes d'un fichier donné au planificateur |
abstract void | await () Attend que le planificateur commence à s'exécuter, y compris en attendant que le transfert de l'ancien TF se termine, le cas échéant. |
abstract void | displayCommandQueue (PrintWriter printWriter) Affiche des informations de débogage détaillées sur l'état de la file d'attente d'exécution des commandes. |
abstract void | displayCommandsInfo (PrintWriter printWriter, String regex) Afficher une liste des commandes actuelles. |
abstract void | displayInvocationsInfo (PrintWriter printWriter) Affiche une liste des appels en cours. |
abstract void | dumpCommandsXml (PrintWriter printWriter, String regex) Videz le fichier xml développé pour la commande avec toutes les valeurs |
abstract long | execCommand ( IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args) Alloue directement un périphérique et exécute une commande sans l'ajouter à la file d'attente de commandes à l'aide d'un |
abstract long | execCommand ( ICommandScheduler.IScheduledInvocationListener listener, String[] args) Alloue directement un périphérique et exécute une commande sans l'ajouter à la file d'attente de commandes. |
abstract long | execCommand ( ICommandScheduler.IScheduledInvocationListener listener, devices, String[] args) execCommand ( ICommandScheduler.IScheduledInvocationListener listener, devices, String[] args) Exécutez directement la commande sur les appareils déjà alloués. |
abstract CommandFileWatcher | getCommandFileWatcher () Obtenez le |
abstract int | getExecutingCommandCount () Renvoie le nombre de commandes en état d'exécution. |
abstract String | getInvocationInfo (int invocationId) Renvoie les informations sur un bu d'invocation en précisant l'id d'invocation. |
abstract CommandRunner.ExitCode | getLastInvocationExitCode () Renvoie le code d'erreur du dernier appel exécuté. |
abstract Throwable | getLastInvocationThrowable () Renvoie l' |
abstract int | getReadyCommandCount () Renvoie le nombre de commandes à l'état prêt dans la file d'attente. |
abstract boolean | isDeviceInInvocationThread ( ITestDevice device) Renvoie true si le périphérique est utilisé par un thread d'invocation actif. |
abstract void | join () Attend que le planificateur se termine. |
abstract void | join (long millis) Attend que le planificateur se termine ou expire après la durée spécifiée en millisecondes. |
abstract void | removeAllCommands () Supprimer toutes les commandes du planificateur |
abstract void | setClearcutClient (ClearcutClient client) Configurer le client pour qu'il signale les données du harnais |
abstract boolean | shouldShutdownOnCmdfileError () Renvoie vrai si nous devons arrêter le planificateur sur une erreur de commande |
default void | shutdown () Essayez d'arrêter correctement le planificateur de commandes. |
abstract void | shutdown (boolean notifyStop) Essayez d'arrêter correctement le planificateur de commandes. |
abstract void | shutdownHard (boolean killAdb) Essayez d'arrêter de force le planificateur de commandes. |
abstract void | shutdownHard () Essayez d'arrêter de force le planificateur de commandes. |
abstract void | shutdownOnEmpty () Similaire à |
abstract void | start () Démarrez le |
abstract boolean | stopInvocation (int invocationId, String cause) Arrêtez une invocation en cours en spécifiant son identifiant. |
default boolean | stopInvocation (int invocationId) Arrêtez une invocation en cours en spécifiant son identifiant. |
abstract boolean | stopInvocation ( ITestInvocation invocation) Arrête un appel en cours d'exécution. |
Méthodes publiques
addCommand
public abstract Pair<Boolean, Integer> addCommand (String[] args)
Ajoute une commande au planificateur.
Une commande est essentiellement une instance d'une configuration à exécuter et ses arguments associés.
Si l'argument "--help" est spécifié, le texte d'aide pour la configuration sera affiché sur stdout. Sinon, la configuration sera ajoutée à la file d'attente à exécuter.
Paramètres | |
---|---|
args | String : les arguments de configuration. |
Retour | |
---|---|
Pair <Boolean, Integer> | Une paire de valeurs, la première valeur est un booléen true si la commande a été ajoutée avec succès. La deuxième valeur est l'identifiant de suivi de commande connu (valeur non négative) si la commande a été ajoutée avec succès, renvoie 0 lorsque la commande est ajoutée pour tous les appareils, sinon -1. |
Lance | |
---|---|
ConfigurationException | si la commande n'a pas pu être analysée |
Voir également:
addCommandFile
public abstract void addCommandFile (String cmdFile,extraArgs)
Ajoute toutes les commandes d'un fichier donné au planificateur
Paramètres | |
---|---|
cmdFile | String : le chemin du système de fichiers du fichier de commande |
extraArgs | ERROR(/List) d'arguments ERROR(/String) à ajouter à chaque commande analysée à partir du fichier. Peut être vide mais ne doit pas être nul. |
Lance | |
---|---|
ConfigurationException | si le fichier de commandes n'a pas pu être analysé |
Voir également:
attendre
public abstract void await ()
Attend que le planificateur commence à s'exécuter, y compris en attendant que le transfert de l'ancien TF se termine, le cas échéant.
displayCommandQueue
public abstract void displayCommandQueue (PrintWriter printWriter)
Affiche des informations de débogage détaillées sur l'état de la file d'attente d'exécution des commandes.
displayCommandsInfo
public abstract void displayCommandsInfo (PrintWriter printWriter, String regex)
Afficher une liste des commandes actuelles.
Paramètres | |
---|---|
printWriter | PrintWriter : l' ERROR(/PrintWriter) vers laquelle sortir. |
regex | String : l'expression régulière à laquelle les commandes doivent correspondre pour être imprimées. Si null, toutes les commandes seront imprimées. |
displayInvocationsInfo
public abstract void displayInvocationsInfo (PrintWriter printWriter)
Affiche une liste des appels en cours.
Paramètres | |
---|---|
printWriter | PrintWriter : l' ERROR(/PrintWriter) vers laquelle sortir. |
dumpCommandsXml
public abstract void dumpCommandsXml (PrintWriter printWriter, String regex)
Videz le fichier xml développé pour la commande avec toutes les valeurs Option
spécifiées pour toutes les commandes en cours.
Paramètres | |
---|---|
printWriter | PrintWriter : l' ERROR(/PrintWriter) pour afficher l'état. |
regex | String : l'expression régulière à laquelle les commandes doivent correspondre pour que le fichier xml soit vidé. Si null, toutes les commandes seront vidées. |
execCommand
public abstract long execCommand (IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)
Alloue directement un périphérique et exécute une commande sans l'ajouter à la file d'attente de commandes à l'aide d'un IInvocationContext
déjà existant.
Paramètres | |
---|---|
context | IInvocationContext : un IInvocationContext existant. |
listener | ICommandScheduler.IScheduledInvocationListener : le ICommandScheduler.IScheduledInvocationListener à informer |
args | String : les arguments de la commande |
Retour | |
---|---|
long |
Lance | |
---|---|
ConfigurationException | si la commande était invalide |
NoDeviceException | s'il n'y a pas d'appareil à utiliser |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, String[] args)
Alloue directement un périphérique et exécute une commande sans l'ajouter à la file d'attente de commandes.
Paramètres | |
---|---|
listener | ICommandScheduler.IScheduledInvocationListener : le ICommandScheduler.IScheduledInvocationListener à informer |
args | String : les arguments de la commande |
Retour | |
---|---|
long | ID d'appel de la commande planifiée. |
Lance | |
---|---|
ConfigurationException | si la commande était invalide |
NoDeviceException | s'il n'y a pas d'appareil à utiliser |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener,devices, String[] args)
Exécutez directement la commande sur les appareils déjà alloués.
Paramètres | |
---|---|
listener | ICommandScheduler.IScheduledInvocationListener : le ICommandScheduler.IScheduledInvocationListener à informer |
devices | ERROR(/List ) ERROR(/List ) à utiliser |
args | String : les arguments de la commande |
Retour | |
---|---|
long | ID d'appel de la commande planifiée. |
Lance | |
---|---|
ConfigurationException | si la commande était invalide |
getCommandFileWatcher
public abstract CommandFileWatcher getCommandFileWatcher ()
Obtenez le CommandFileWatcher
approprié pour ce planificateur
Retour | |
---|---|
CommandFileWatcher |
getExecutingCommandCount
public abstract int getExecutingCommandCount ()
Renvoie le nombre de commandes en état d'exécution.
Retour | |
---|---|
int |
getInvocationInfo
public abstract String getInvocationInfo (int invocationId)
Renvoie les informations sur un bu d'invocation en précisant l'id d'invocation.
Paramètres | |
---|---|
invocationId | int : l'identifiant de suivi de l'invocation. |
Retour | |
---|---|
String | Une ERROR(/String) contenant des informations sur l'appel. |
getLastInvocationExitCode
public abstract CommandRunner.ExitCode getLastInvocationExitCode ()
Renvoie le code d'erreur du dernier appel exécuté. Renvoie 0 (pas d'erreur), si aucune invocation n'a encore été exécutée.
Retour | |
---|---|
CommandRunner.ExitCode |
getLastInvocationThrowable
public abstract Throwable getLastInvocationThrowable ()
Renvoie l' ERROR(/Throwable)
de la dernière invocation exécutée. Renvoie null, si aucun jetable n'est disponible.
Retour | |
---|---|
Throwable |
getReadyCommandCount
public abstract int getReadyCommandCount ()
Renvoie le nombre de commandes à l'état prêt dans la file d'attente.
Retour | |
---|---|
int |
isDeviceInInvocationThread
public abstract boolean isDeviceInInvocationThread (ITestDevice device)
Renvoie true si le périphérique est utilisé par un thread d'invocation actif.
Paramètres | |
---|---|
device | ITestDevice |
Retour | |
---|---|
boolean |
rejoindre
public abstract void join ()
Attend que le planificateur se termine.
Voir également:
rejoindre
public abstract void join (long millis)
Attend que le planificateur se termine ou expire après la durée spécifiée en millisecondes.
Paramètres | |
---|---|
millis | long |
Voir également:
removeAllCommands
public abstract void removeAllCommands ()
Supprimer toutes les commandes du planificateur
setClearcutClient
public abstract void setClearcutClient (ClearcutClient client)
Configurer le client pour qu'il signale les données du harnais
Paramètres | |
---|---|
client | ClearcutClient |
devraitShutdownOnCmdfileError
public abstract boolean shouldShutdownOnCmdfileError ()
Renvoie vrai si nous devons arrêter le planificateur sur une erreur de commande
Retour | |
---|---|
boolean |
fermer
public void shutdown ()
Essayez d'arrêter correctement le planificateur de commandes.
Efface les commandes en attente de test et demande que toutes les invocations en cours s'arrêtent normalement.
Après l'appel de shutdown, la boucle principale du planificateur attendra que toutes les invocations en cours soient terminées avant de se terminer complètement.
fermer
public abstract void shutdown (boolean notifyStop)
Essayez d'arrêter correctement le planificateur de commandes.
Paramètres | |
---|---|
notifyStop | boolean : si vrai, notifie les invocations de l'arrêt de TF. |
arrêt dur
public abstract void shutdownHard (boolean killAdb)
Essayez d'arrêter de force le planificateur de commandes.
Similaire à shutdown()
, mais tuera également éventuellement la connexion adb, dans une tentative "d'inspirer" les invocations en cours pour qu'elles se terminent plus rapidement.
Paramètres | |
---|---|
killAdb | boolean |
arrêt dur
public abstract void shutdownHard ()
Essayez d'arrêter de force le planificateur de commandes. Identique à shutdownHard(true).
shutdownOnEmpty
public abstract void shutdownOnEmpty ()
Similaire à shutdown()
, mais attendra à la place que toutes les commandes soient exécutées avant de quitter.
commencer
public abstract void start ()
Démarrez le ICommandScheduler
.
shutdown()
soit appelé. voir ERROR(/Thread#start())
. stopInvocation
public abstract boolean stopInvocation (int invocationId, String cause)
Arrêtez une invocation en cours en spécifiant son identifiant.
Paramètres | |
---|---|
invocationId | int : l'identifiant de suivi de l'invocation. |
cause | String : la cause de l'arrêt de l'invocation. |
Retour | |
---|---|
boolean | vrai si l'invocation a été arrêtée, faux sinon |
Lance | |
---|---|
| si l'implémentation ne le supporte pas |
stopInvocation
public boolean stopInvocation (int invocationId)
Arrêtez une invocation en cours en spécifiant son identifiant.
Paramètres | |
---|---|
invocationId | int |
Retour | |
---|---|
boolean | vrai si l'invocation a été arrêtée, faux sinon |
Lance | |
---|---|
| si l'implémentation ne le supporte pas |
stopInvocation
public abstract boolean stopInvocation (ITestInvocation invocation)
Arrête un appel en cours d'exécution.
Paramètres | |
---|---|
invocation | ITestInvocation |
Retour | |
---|---|
boolean | vrai si l'invocation a été arrêtée, faux sinon |
Lance | |
---|---|
| si l'implémentation ne le supporte pas |
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2023/03/30 (UTC).