ICommandScheduler
public
interface
ICommandScheduler
| com.android.tradefed.command.ICommandScheduler |
TradeFederation 명령어를 실행하는 스케줄러입니다.
요약
중첩된 클래스 | |
|---|---|
interface |
ICommandScheduler.IScheduledInvocationListener
호출이 완료될 때 호출 이벤트 리스너입니다. |
공개 메서드 | |
|---|---|
abstract
Pair<Boolean, Integer>
|
addCommand(String[] args)
스케줄러에 명령어를 추가합니다. |
abstract
void
|
addCommandFile(String cmdFile,
지정된 파일의 모든 명령어를 스케줄러에 추가 |
abstract
void
|
await()
이전 TF에서 핸드오버가 완료되기를 기다리는 등 스케줄러가 실행되기를 기다립니다(해당하는 경우). |
abstract
void
|
displayCommandQueue(PrintWriter printWriter)
명령어 실행 대기열 상태에 관한 자세한 디버그 정보를 출력합니다. |
abstract
void
|
displayCommandsInfo(PrintWriter printWriter, String regex)
현재 명령어 목록을 출력합니다. |
abstract
void
|
displayInvocationsInfo(PrintWriter printWriter)
현재 호출 목록을 표시합니다. |
abstract
void
|
dumpCommandsXml(PrintWriter printWriter, String regex)
모든 현재 명령어에 지정된 모든 |
abstract
long
|
execCommand(IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)
이미 있는 |
abstract
long
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener, String[] args)
명령어 대기열에 추가하지 않고 기기를 직접 할당하고 명령어를 실행합니다. |
abstract
long
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener, ITestDevice device, String[] args)
이미 할당된 기기에서 명령어를 직접 실행합니다. |
abstract
long
|
execCommand(ICommandScheduler.IScheduledInvocationListener listener,
이미 할당된 기기에서 명령어를 직접 실행합니다. |
abstract
CommandFileWatcher
|
getCommandFileWatcher()
이 스케줄러에 적합한 CommandFileWatcher 가져오기 |
abstract
int
|
getExecutingCommandCount()
실행 상태의 명령어 수를 반환합니다. |
abstract
String
|
getInvocationInfo(int invocationId)
호출 ID를 지정하여 호출에 관한 정보를 반환합니다. |
abstract
CommandRunner.ExitCode
|
getLastInvocationExitCode()
실행된 마지막 호출의 오류 코드를 반환합니다. |
abstract
Throwable
|
getLastInvocationThrowable()
실행된 마지막 호출에서 |
abstract
int
|
getReadyCommandCount()
대기열에서 준비 상태인 명령의 수를 반환합니다. |
abstract
boolean
|
isDeviceInInvocationThread(ITestDevice device)
활성 호출 스레드에서 기기를 사용하는 경우 true를 반환합니다. |
abstract
void
|
join()
스케줄러가 완료될 때까지 기다립니다. |
abstract
void
|
join(long millis)
스케줄러가 완료되거나 밀리초 단위로 지정된 기간이 지난 후 제한 시간이 초과될 때까지 기다립니다. |
abstract
void
|
removeAllCommands()
스케줄러에서 모든 명령어 삭제 |
abstract
void
|
setClearcutClient(ClearcutClient client)
하네스 데이터를 보고하도록 클라이언트 설정 |
default
void
|
setMaxPollTime(long polling)
|
default
void
|
setPrintSchedulingWarning(boolean print)
|
abstract
boolean
|
shouldShutdownOnCmdfileError()
명령어 오류 시 스케줄러를 종료해야 하는 경우 true를 반환합니다. |
default
void
|
shutdown()
명령어 스케줄러를 단계적으로 종료하려고 시도합니다. |
abstract
void
|
shutdown(boolean notifyStop)
명령어 스케줄러를 단계적으로 종료하려고 시도합니다. |
abstract
void
|
shutdownHard(boolean killAdb)
명령어 스케줄러를 강제 종료하려고 시도합니다. |
abstract
void
|
shutdownHard()
명령어 스케줄러를 강제 종료하려고 시도합니다. |
abstract
void
|
shutdownOnEmpty()
|
abstract
void
|
start()
|
abstract
boolean
|
stopInvocation(int invocationId, String cause)
ID를 지정하여 실행 중인 호출을 중지합니다. |
default
boolean
|
stopInvocation(int invocationId)
ID를 지정하여 실행 중인 호출을 중지합니다. |
abstract
boolean
|
stopInvocation(ITestInvocation invocation)
실행 중인 호출을 중지합니다. |
default
void
|
stopScheduling()
새 테스트의 예약 및 수락을 중지하지만 Tradefed는 중지하지 않습니다. |
공개 메서드
addCommand
public abstract Pair<Boolean, Integer> addCommand (String[] args)
스케줄러에 명령어를 추가합니다.
명령어는 기본적으로 실행할 구성과 연결된 인스턴스입니다.
'--help' 인수가 지정되면 구성에 대한 도움말 텍스트가 stdout에 출력됩니다. 그렇지 않으면 실행할 구성이 대기열에 추가됩니다.
| 매개변수 | |
|---|---|
args |
String: 구성 인수입니다. |
| 반환 값 | |
|---|---|
Pair<Boolean, Integer> |
값 쌍입니다. 첫 번째 값은 명령어가 성공적으로 추가된 경우 불리언 true입니다. 두 번째 값은 명령어가 성공적으로 추가된 경우 알려진 명령 추적기 ID(음수가 아닌 값)입니다. 명령어가 모든 기기에 추가된 경우 0을 반환하고 그렇지 않으면 -1을 반환합니다. |
| 생성 값 | |
|---|---|
ConfigurationException |
명령어를 파싱할 수 없는 경우 |
addCommandFile
public abstract void addCommandFile (String cmdFile,
extraArgs) 지정된 파일의 모든 명령어를 스케줄러에 추가
| 매개변수 | |
|---|---|
cmdFile |
String: 명령 파일의 파일 시스템 경로 |
extraArgs |
: 파일에서 파싱된 각 명령어에 추가할 String 인수의 ERROR(/List)입니다. 비어 있을 수 있지만 null이어서는 안 됩니다. |
| 생성 값 | |
|---|---|
ConfigurationException |
명령어 파일을 파싱할 수 없는 경우 |
await
public abstract void await ()
이전 TF에서 핸드오버가 완료되기를 기다리는 등 스케줄러가 실행되기를 기다립니다(해당하는 경우).
displayCommandQueue
public abstract void displayCommandQueue (PrintWriter printWriter)
명령어 실행 대기열 상태에 관한 자세한 디버그 정보를 출력합니다.
displayCommandsInfo
public abstract void displayCommandsInfo (PrintWriter printWriter,
String regex)현재 명령어 목록을 출력합니다.
| 매개변수 | |
|---|---|
printWriter |
PrintWriter: 출력할 ERROR(/PrintWriter)입니다. |
regex |
String: 명령어가 출력되려면 일치해야 하는 정규 표현식입니다. null인 경우 모든 명령어가 출력됩니다. |
displayInvocationsInfo
public abstract void displayInvocationsInfo (PrintWriter printWriter)
현재 호출 목록을 표시합니다.
| 매개변수 | |
|---|---|
printWriter |
PrintWriter: 출력할 ERROR(/PrintWriter)입니다. |
dumpCommandsXml
public abstract void dumpCommandsXml (PrintWriter printWriter,
String regex)모든 현재 명령어에 지정된 모든 Option 값을 사용하여 명령어의 확장된 xml 파일을 덤프합니다.
| 매개변수 | |
|---|---|
printWriter |
PrintWriter: 상태를 출력할 ERROR(/PrintWriter)입니다. |
regex |
String: XML 파일을 덤프하기 위해 명령어가 일치해야 하는 정규 표현식입니다. null인 경우 모든 명령어가 덤프됩니다. |
execCommand
public abstract long execCommand (IInvocationContext context, ICommandScheduler.IScheduledInvocationListener listener, String[] args)
이미 있는 IInvocationContext를 사용하여 명령어를 명령 대기열에 추가하지 않고 기기를 직접 할당하고 명령어를 실행합니다.
| 매개변수 | |
|---|---|
context |
IInvocationContext: 기존 IInvocationContext |
listener |
ICommandScheduler.IScheduledInvocationListener: 알림을 받을 ICommandScheduler.IScheduledInvocationListener |
args |
String: 명령어 인수 |
| 반환 값 | |
|---|---|
long |
|
| 생성 값 | |
|---|---|
ConfigurationException |
명령어가 잘못된 경우 |
NoDeviceException |
사용할 기기가 없는 경우 |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, String[] args)
명령어 대기열에 추가하지 않고 기기를 직접 할당하고 명령어를 실행합니다.
| 매개변수 | |
|---|---|
listener |
ICommandScheduler.IScheduledInvocationListener: 알림을 받을 ICommandScheduler.IScheduledInvocationListener |
args |
String: 명령어 인수 |
| 반환 값 | |
|---|---|
long |
예약된 명령어의 호출 ID입니다. |
| 생성 값 | |
|---|---|
ConfigurationException |
명령어가 잘못된 경우 |
NoDeviceException |
사용할 기기가 없는 경우 |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, ITestDevice device, String[] args)
이미 할당된 기기에서 명령어를 직접 실행합니다.
| 매개변수 | |
|---|---|
listener |
ICommandScheduler.IScheduledInvocationListener: 알림을 받을 ICommandScheduler.IScheduledInvocationListener |
device |
ITestDevice: 사용할 ITestDevice |
args |
String: 명령어 인수 |
| 반환 값 | |
|---|---|
long |
예약된 명령어의 호출 ID입니다. |
| 생성 값 | |
|---|---|
ConfigurationException |
명령어가 잘못된 경우 |
execCommand
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener,devices, String[] args)
이미 할당된 기기에서 명령어를 직접 실행합니다.
| 매개변수 | |
|---|---|
listener |
ICommandScheduler.IScheduledInvocationListener: 알림을 받을 ICommandScheduler.IScheduledInvocationListener |
devices |
: 사용할 ERROR(/List |
args |
String: 명령어 인수 |
| 반환 값 | |
|---|---|
long |
예약된 명령어의 호출 ID입니다. |
| 생성 값 | |
|---|---|
ConfigurationException |
명령어가 잘못된 경우 |
getCommandFileWatcher
public abstract CommandFileWatcher getCommandFileWatcher ()
이 스케줄러에 적합한 CommandFileWatcher 가져오기
| 반환 값 | |
|---|---|
CommandFileWatcher |
|
getExecutingCommandCount
public abstract int getExecutingCommandCount ()
실행 상태의 명령어 수를 반환합니다.
| 반환 값 | |
|---|---|
int |
|
getInvocationInfo
public abstract String getInvocationInfo (int invocationId)
호출 ID를 지정하여 호출에 관한 정보를 반환합니다.
| 매개변수 | |
|---|---|
invocationId |
int: 호출의 추적 ID입니다. |
| 반환 값 | |
|---|---|
String |
호출에 관한 정보가 포함된 String |
getLastInvocationExitCode
public abstract CommandRunner.ExitCode getLastInvocationExitCode ()
실행된 마지막 호출의 오류 코드를 반환합니다. 아직 호출이 실행되지 않은 경우 0 (오류 없음)을 반환합니다.
| 반환 값 | |
|---|---|
CommandRunner.ExitCode |
|
getLastInvocationThrowable
public abstract Throwable getLastInvocationThrowable ()
실행된 마지막 호출에서 Throwable를 반환합니다.
throwable을 사용할 수 없는 경우 null을 반환합니다.
| 반환 값 | |
|---|---|
Throwable |
|
getReadyCommandCount
public abstract int getReadyCommandCount ()
대기열에서 준비 상태인 명령의 수를 반환합니다.
| 반환 값 | |
|---|---|
int |
|
isDeviceInInvocationThread
public abstract boolean isDeviceInInvocationThread (ITestDevice device)
활성 호출 스레드에서 기기를 사용하는 경우 true를 반환합니다.
| 매개변수 | |
|---|---|
device |
ITestDevice |
| 반환 값 | |
|---|---|
boolean |
|
join
public abstract void join (long millis)
스케줄러가 완료되거나 밀리초 단위로 지정된 기간이 지난 후 제한 시간이 초과될 때까지 기다립니다.
| 매개변수 | |
|---|---|
millis |
long |
removeAllCommands
public abstract void removeAllCommands ()
스케줄러에서 모든 명령어 삭제
setClearcutClient
public abstract void setClearcutClient (ClearcutClient client)
하네스 데이터를 보고하도록 클라이언트 설정
| 매개변수 | |
|---|---|
client |
ClearcutClient |
setMaxPollTime
public void setMaxPollTime (long polling)
| 매개변수 | |
|---|---|
polling |
long |
setPrintSchedulingWarning
public void setPrintSchedulingWarning (boolean print)
| 매개변수 | |
|---|---|
print |
boolean |
shouldShutdownOnCmdfileError
public abstract boolean shouldShutdownOnCmdfileError ()
명령어 오류 시 스케줄러를 종료해야 하는 경우 true를 반환합니다.
| 반환 값 | |
|---|---|
boolean |
|
종료
public void shutdown ()
명령어 스케줄러를 단계적으로 종료하려고 시도합니다.
테스트를 기다리는 명령어를 지우고 진행 중인 모든 호출이 정상적으로 종료되도록 요청합니다.
종료가 호출된 후 스케줄러 기본 루프는 진행 중인 모든 호출이 완료될 때까지 기다린 후 완전히 종료됩니다.
종료
public abstract void shutdown (boolean notifyStop)
명령어 스케줄러를 단계적으로 종료하려고 시도합니다.
| 매개변수 | |
|---|---|
notifyStop |
boolean: true인 경우 TF 종료 호출을 알립니다. |
shutdownHard
public abstract void shutdownHard (boolean killAdb)
명령어 스케줄러를 강제 종료하려고 시도합니다.
shutdown()와 유사하지만 진행 중인 호출이 더 빨리 완료되도록 '유도'하기 위해 선택적으로 adb 연결을 종료하기도 합니다.
| 매개변수 | |
|---|---|
killAdb |
boolean |
shutdownHard
public abstract void shutdownHard ()
명령어 스케줄러를 강제 종료하려고 시도합니다. shutdownHard(true)와 동일합니다.
shutdownOnEmpty
public abstract void shutdownOnEmpty ()
shutdown()와 유사하지만 종료하기 전에 모든 명령어가 실행될 때까지 기다립니다.
명령어가 루프 모드에 있으면 스케줄러가 종료되지 않습니다.
start
public abstract void start ()
ICommandScheduler을 시작합니다.
다른 메서드를 호출하기 전에 호출해야 합니다.
shutdown()가 호출될 때까지 실행됩니다.
Thread.start()를 참고하세요.
stopInvocation
public abstract boolean stopInvocation (int invocationId,
String cause)ID를 지정하여 실행 중인 호출을 중지합니다.
| 매개변수 | |
|---|---|
invocationId |
int: 호출의 추적 ID입니다. |
cause |
String: 호출 중지의 원인입니다. |
| 반환 값 | |
|---|---|
boolean |
호출이 중지된 경우 true, 그렇지 않은 경우 false |
| 생성 값 | |
|---|---|
UnsupportedOperationException |
구현에서 이를 지원하지 않는 경우 |
stopInvocation
public boolean stopInvocation (int invocationId)
ID를 지정하여 실행 중인 호출을 중지합니다.
| 매개변수 | |
|---|---|
invocationId |
int |
| 반환 값 | |
|---|---|
boolean |
호출이 중지된 경우 true, 그렇지 않은 경우 false |
| 생성 값 | |
|---|---|
UnsupportedOperationException |
구현에서 이를 지원하지 않는 경우 |
stopInvocation
public abstract boolean stopInvocation (ITestInvocation invocation)
실행 중인 호출을 중지합니다.
| 매개변수 | |
|---|---|
invocation |
ITestInvocation |
| 반환 값 | |
|---|---|
boolean |
호출이 중지된 경우 true, 그렇지 않은 경우 false |
| 생성 값 | |
|---|---|
UnsupportedOperationException |
구현에서 이를 지원하지 않는 경우 |
stopScheduling
public void stopScheduling ()
새 테스트의 예약 및 수락을 중지하지만 Tradefed는 중지하지 않습니다. 이는 먼저 실행 중인 모든 테스트를 드레인한 다음 Tradefed 프로세스를 종료하는 2단계 종료를 지원하기 위한 것입니다.