ICommandScheduler
public
interface
ICommandScheduler
com.android.tradefed.command.ICommandScheduler |
Un planificateur pour exécuter des commandes TradeFederation.
Résumé
Classes imbriquées | |
---|---|
interface |
ICommandScheduler.IScheduledInvocationListener
Écouteur des événements d'invocation une fois l'invocation terminée. |
Méthodes publiques | |
---|---|
abstract
boolean
|
addCommand(String[] args)
Ajoute une commande au planificateur. |
abstract
void
|
addCommandFile(String cmdFile,
Ajoute toutes les commandes du fichier donné au planificateur |
abstract
void
|
await()
Attend que le planificateur commence à s'exécuter, y compris qu'il attend la fin de la transition de l'ancien TF, le cas échéant. |
abstract
void
|
completeHandover()
Informe le planificateur de commandes qu'une séquence de transfert lancée est complètement terminée et qu'il doit réinitialiser son gestionnaire à distance sur le port par défaut. |
abstract
void
|
displayCommandQueue(PrintWriter printWriter)
Affiche des informations de débogage détaillées sur l'état de la file d'exécution des commandes. |
abstract
void
|
displayCommandsInfo(PrintWriter printWriter, String regex)
Affiche une liste des commandes en cours. |
abstract
void
|
displayInvocationsInfo(PrintWriter printWriter)
Affiche la liste des invocations en cours. |
abstract
void
|
dumpCommandsXml(PrintWriter printWriter, String regex)
Videz le fichier XML développé pour la commande avec toutes les valeurs |
abstract
void
|
execCommand(IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)
Alloue directement un appareil et exécute une commande sans l'ajouter à la file d'attente de commandes à l'aide d'un |
abstract
void
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener, String[] args)
Alloue directement un appareil et exécute une commande sans l'ajouter à la file d'attente de commandes. |
abstract
void
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener, ITestDevice device, String[] args)
Exécutez directement la commande sur un appareil déjà alloué. |
abstract
CommandFileWatcher
|
getCommandFileWatcher()
Obtenir le |
abstract
int
|
getExecutingCommandCount()
Renvoie le nombre de commandes en cours d'exécution. |
abstract
String
|
getInvocationInfo(int invocationId)
Renvoyez les informations sur une invocation en spécifiant l'ID d'invocation. |
abstract
CommandRunner.ExitCode
|
getLastInvocationExitCode()
Renvoie le code d'erreur de la dernière invocation exécutée. |
abstract
Throwable
|
getLastInvocationThrowable()
Renvoie le |
abstract
int
|
getReadyCommandCount()
Renvoie le nombre de commandes prêtes dans la file d'attente. |
abstract
void
|
handoverInitiationComplete()
Informe le planificateur de commandes que l'échange initial de transfert des appareils et des commandes en cours d'utilisation est terminé et qu'il peut commencer à planifier l'opération. |
abstract
boolean
|
handoverShutdown(int handoverPort)
Lance un |
abstract
void
|
join()
Attend que le planificateur ait terminé. |
abstract
void
|
join(long millis)
Attend que le planificateur ait terminé ou que le délai d'expiration soit atteint 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 générer des rapports sur les données du faisceau |
abstract
boolean
|
shouldShutdownOnCmdfileError()
Renvoie la valeur "true" si nous devons arrêter le planificateur en cas d'erreur de commande. |
abstract
void
|
shutdown()
Essayez d'arrêter de manière appropriée le planificateur de commandes. |
abstract
void
|
shutdownHard(boolean killAdb)
Tentative d'arrêt forcé du planificateur de commandes. |
abstract
void
|
shutdownHard()
Tentative d'arrêt forcé du planificateur de commandes. |
abstract
void
|
shutdownOnEmpty()
Semblable à |
abstract
void
|
start()
Démarrez |
abstract
boolean
|
stopInvocation(int invocationId, String cause)
Arrêtez une invocation en cours d'exécution en spécifiant son ID. |
default
boolean
|
stopInvocation(int invocationId)
Arrêtez une invocation en cours d'exécution en spécifiant son ID. |
abstract
boolean
|
stopInvocation(ITestInvocation invocation)
Arrêtez une invocation en cours d'exécution. |
Méthodes publiques
addCommand
public abstract boolean addCommand (String[] args)
Ajoute une commande au planificateur.
Une commande est essentiellement une instance d'une configuration à exécuter et de ses arguments associés.
Si l'argument "--help" est spécifié, le texte d'aide de la configuration est affiché sur la sortie standard. Sinon, la configuration sera ajoutée à la file d'attente pour être exécutée.
Paramètres | |
---|---|
args |
String : arguments de configuration. |
Renvoie | |
---|---|
boolean |
true si la commande a bien été ajoutée |
Génère | |
---|---|
ConfigurationException |
si la commande n'a pas pu être analysée |
addCommandFile
public abstract void addCommandFile (String cmdFile,extraArgs)
Ajoute toutes les commandes du fichier donné au planificateur
Paramètres | |
---|---|
cmdFile |
String : chemin d'accès au système de fichiers du fichier de commande |
extraArgs |
: ERROR(/List) d'arguments String à ajouter à chaque commande analysée à partir d'un fichier. Peut être vide, mais ne doit pas être nul. |
Génère | |
---|---|
ConfigurationException |
si le fichier de commande ne peut pas être analysé |
Voir aussi :
await
public abstract void await ()
Attend que le planificateur commence à s'exécuter, y compris qu'il attend la fin de la transition de l'ancien TF, le cas échéant.
completeHandover
public abstract void completeHandover ()
Informe le planificateur de commandes qu'une séquence de transfert lancée est complètement terminée et qu'il doit réinitialiser son gestionnaire à distance sur le port par défaut.
displayCommandQueue
public abstract void displayCommandQueue (PrintWriter printWriter)
Affiche des informations de débogage détaillées sur l'état de la file d'exécution des commandes.
displayCommandsInfo
public abstract void displayCommandsInfo (PrintWriter printWriter, String regex)
Affiche une liste des commandes en cours.
Paramètres | |
---|---|
printWriter |
PrintWriter : ERROR(/PrintWriter) à utiliser pour la sortie. |
regex |
String : expression régulière à laquelle les commandes doivent correspondre pour être imprimées. Si la valeur est nulle, toutes les commandes sont imprimées.
|
displayInvocationsInfo
public abstract void displayInvocationsInfo (PrintWriter printWriter)
Affiche la liste des invocations en cours.
Paramètres | |
---|---|
printWriter |
PrintWriter : ERROR(/PrintWriter) à utiliser pour la sortie.
|
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 : ERROR(/PrintWriter) à utiliser pour afficher l'état. |
regex |
String : expression régulière à laquelle les commandes doivent correspondre pour que le fichier XML soit extrait. Si la valeur est nulle, toutes les commandes sont affichées.
|
execCommand
public abstract void execCommand (IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)
Alloue directement un appareil 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 : IInvocationContext existant. |
listener |
ICommandScheduler.IScheduledInvocationListener : ICommandScheduler.IScheduledInvocationListener à informer |
args |
String : arguments de la commande |
Génère | |
---|---|
ConfigurationException |
si la commande n'est pas valide |
NoDeviceException |
si aucun appareil n'est disponible |
execCommand
public abstract void execCommand (ICommandScheduler.IScheduledInvocationListener listener, String[] args)
Alloue directement un appareil et exécute une commande sans l'ajouter à la file d'attente de commandes.
Paramètres | |
---|---|
listener |
ICommandScheduler.IScheduledInvocationListener : ICommandScheduler.IScheduledInvocationListener à informer |
args |
String : arguments de la commande |
Génère | |
---|---|
ConfigurationException |
si la commande n'est pas valide |
NoDeviceException |
si aucun appareil n'est disponible |
execCommand
public abstract void execCommand (ICommandScheduler.IScheduledInvocationListener listener, ITestDevice device, String[] args)
Exécutez directement la commande sur un appareil déjà alloué.
Paramètres | |
---|---|
listener |
ICommandScheduler.IScheduledInvocationListener : ICommandScheduler.IScheduledInvocationListener à informer |
device |
ITestDevice : ITestDevice à utiliser |
args |
String : arguments de la commande |
Génère | |
---|---|
ConfigurationException |
si la commande n'est pas valide |
getCommandFileWatcher
public abstract CommandFileWatcher getCommandFileWatcher ()
Obtenir le CommandFileWatcher
approprié pour ce planificateur
Renvoie | |
---|---|
CommandFileWatcher |
getExecutingCommandCount
public abstract int getExecutingCommandCount ()
Renvoie le nombre de commandes en cours d'exécution.
Renvoie | |
---|---|
int |
getInvocationInfo
public abstract String getInvocationInfo (int invocationId)
Renvoyez les informations sur une invocation en spécifiant l'ID d'invocation.
Paramètres | |
---|---|
invocationId |
int : ID de suivi de l'appel. |
Renvoie | |
---|---|
String |
String contenant des informations sur l'appel.
|
getLastInvocationExitCode
public abstract CommandRunner.ExitCode getLastInvocationExitCode ()
Renvoie le code d'erreur de la dernière invocation exécutée. Renvoie 0 (aucune erreur) si aucune invocation n'a encore été exécutée.
Renvoie | |
---|---|
CommandRunner.ExitCode |
getLastInvocationThrowable
public abstract Throwable getLastInvocationThrowable ()
Renvoie le Throwable
de la dernière invocation exécutée.
Renvoie la valeur "null" si aucun throwable n'est disponible.
Renvoie | |
---|---|
Throwable |
getReadyCommandCount
public abstract int getReadyCommandCount ()
Renvoie le nombre de commandes prêtes dans la file d'attente.
Renvoie | |
---|---|
int |
handoverInitiationComplete
public abstract void handoverInitiationComplete ()
Informe le planificateur de commandes que l'échange initial de transfert des appareils et des commandes en cours d'utilisation est terminé et qu'il peut commencer à planifier l'opération.
handoverShutdown
public abstract boolean handoverShutdown (int handoverPort)
Lance un shutdown()
et un transfert vers un autre processus de tradefed sur ce même hôte.
Le planificateur informe le processus de tradefed à distance qui écoute sur ce port des appareils libérés à mesure qu'ils deviennent disponibles.
Paramètres | |
---|---|
handoverPort |
int |
Renvoie | |
---|---|
boolean |
true si l'initiation du transfert a réussi, false dans le cas contraire
|
rejoindre
public abstract void join ()
Attend que le planificateur ait terminé.
Voir aussi :
rejoindre
public abstract void join (long millis)
Attend que le planificateur ait terminé ou que le délai d'expiration soit atteint après la durée spécifiée en millisecondes.
Paramètres | |
---|---|
millis |
long |
Voir aussi :
removeAllCommands
public abstract void removeAllCommands ()
Supprimer toutes les commandes du planificateur
setClearcutClient
public abstract void setClearcutClient (ClearcutClient client)
Configurer le client pour générer des rapports sur les données du faisceau
Paramètres | |
---|---|
client |
ClearcutClient |
shouldShutdownOnCmdfileError
public abstract boolean shouldShutdownOnCmdfileError ()
Renvoie la valeur "true" si nous devons arrêter le planificateur en cas d'erreur de commande.
Renvoie | |
---|---|
boolean |
arrêt
public abstract void shutdown ()
Essayez d'arrêter de manière appropriée le planificateur de commandes.
Efface les commandes en attente d'être testées et demande à toutes les invocations en cours de s'arrêter correctement.
Une fois l'arrêt appelé, la boucle principale de l'ordonnanceur attend que toutes les invocations en cours soient terminées avant de se fermer complètement.
shutdownHard
public abstract void shutdownHard (boolean killAdb)
Tentative d'arrêt forcé du planificateur de commandes.
Semblable à shutdown()
, mais peut également fermer la connexion adb, dans le but d''inspirer' les invocations en cours pour qu'elles soient effectuées plus rapidement.
Paramètres | |
---|---|
killAdb |
boolean |
shutdownHard
public abstract void shutdownHard ()
Tentative d'arrêt forcé du planificateur de commandes. Identique à shutdownHard(true).
shutdownOnEmpty
public abstract void shutdownOnEmpty ()
Semblable à shutdown()
, mais attend que toutes les commandes soient exécutées avant de se fermer.
Notez que si des commandes sont en mode boucle, le planificateur ne s'arrêtera jamais.
départ
public abstract void start ()
Démarrez ICommandScheduler
.
Doit être appelé avant d'appeler d'autres méthodes.
S'exécute jusqu'à l'appel de shutdown()
.
consultez Thread.start()
.
stopInvocation
public abstract boolean stopInvocation (int invocationId, String cause)
Arrêtez une invocation en cours d'exécution en spécifiant son ID.
Paramètres | |
---|---|
invocationId |
int : ID de suivi de l'appel. |
cause |
String : cause de l'arrêt de l'appel. |
Renvoie | |
---|---|
boolean |
"true" si l'appel a été arrêté, "false" dans le cas contraire |
Génère | |
---|---|
UnsupportedOperationException |
si l'implémentation n'est pas compatible avec cette fonctionnalité |
stopInvocation
public boolean stopInvocation (int invocationId)
Arrêtez une invocation en cours d'exécution en spécifiant son ID.
Paramètres | |
---|---|
invocationId |
int |
Renvoie | |
---|---|
boolean |
"true" si l'appel a été arrêté, "false" dans le cas contraire |
Génère | |
---|---|
UnsupportedOperationException |
si l'implémentation n'est pas compatible avec cette fonctionnalité |
stopInvocation
public abstract boolean stopInvocation (ITestInvocation invocation)
Arrêtez une invocation en cours d'exécution.
Paramètres | |
---|---|
invocation |
ITestInvocation |
Renvoie | |
---|---|
boolean |
"true" si l'appel a été arrêté, "false" dans le cas contraire |
Génère | |
---|---|
UnsupportedOperationException |
si l'implémentation n'est pas compatible avec cette fonctionnalité |