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, extraArgs) addCommandFile (String cmdFile, extraArgs) 지정된 파일의 모든 명령을 스케줄러에 추가합니다. |
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, devices, String[] args) execCommand ( ICommandScheduler.IScheduledInvocationListener listener, devices, String[] args) 이미 할당된 장치에 직접 명령을 실행합니다. |
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) 하네스 데이터를 보고하도록 클라이언트 설정 |
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를 중지하지는 않습니다. |
공개 메소드
add명령
public abstract Pair<Boolean, Integer> addCommand (String[] args)
스케줄러에 명령을 추가합니다.
명령은 기본적으로 실행할 구성 및 관련 인수의 인스턴스입니다.
"--help" 인수가 지정되면 구성에 대한 도움말 텍스트가 stdout으로 출력됩니다. 그렇지 않으면 구성이 실행할 대기열에 추가됩니다.
매개변수 | |
---|---|
args | String : 구성 인수입니다. |
보고 | |
---|---|
Pair <Boolean, Integer> | 값 쌍, 첫 번째 값은 명령이 성공적으로 추가된 경우 부울 true 입니다. 두 번째 값은 알려진 명령 추적기 ID(음수가 아닌 값)입니다. 명령이 성공적으로 추가된 경우 모든 장치에 대해 명령이 추가되면 0을 반환하고, 그렇지 않으면 -1을 반환합니다. |
던지기 | |
---|---|
ConfigurationException | 명령을 구문 분석할 수 없는 경우 |
addCommand파일
public abstract void addCommandFile (String cmdFile,extraArgs)
지정된 파일의 모든 명령을 스케줄러에 추가합니다.
매개변수 | |
---|---|
cmdFile | String : 명령 파일의 파일 시스템 경로 |
extraArgs | String 인수의 ERROR(/List) . 비어 있을 수 있지만 null이 아니어야 합니다. |
던지기 | |
---|---|
ConfigurationException | 명령 파일을 구문 분석할 수 없는 경우 |
또한보십시오:
기다리다
public abstract void await ()
해당되는 경우 이전 TF에서 핸드오버가 완료될 때까지 기다리는 것을 포함하여 스케줄러가 실행되기 시작할 때까지 기다립니다.
디스플레이CommandQueue
public abstract void displayCommandQueue (PrintWriter printWriter)
명령 실행 대기열 상태에 대한 자세한 디버그 정보를 출력합니다.
표시명령정보
public abstract void displayCommandsInfo (PrintWriter printWriter, String regex)
현재 명령 목록을 출력합니다.
매개변수 | |
---|---|
printWriter | PrintWriter : 출력할 ERROR(/PrintWriter) 입니다. |
regex | String : 인쇄하기 위해 명령과 일치해야 하는 정규식입니다. null이면 모든 명령이 인쇄됩니다. |
디스플레이호출정보
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이면 모든 명령이 덤프됩니다. |
exec명령
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 | 사용할 기기가 없다면 |
exec명령
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener, String[] args)
명령 대기열에 추가하지 않고 직접 장치를 할당하고 명령을 실행합니다.
매개변수 | |
---|---|
listener | ICommandScheduler.IScheduledInvocationListener : 알림을 받을 ICommandScheduler.IScheduledInvocationListener |
args | String : 명령 인수 |
보고 | |
---|---|
long | 예약된 명령의 호출 ID입니다. |
던지기 | |
---|---|
ConfigurationException | 명령이 유효하지 않은 경우 |
NoDeviceException | 사용할 기기가 없다면 |
exec명령
public abstract long execCommand (ICommandScheduler.IScheduledInvocationListener listener,devices, String[] args)
이미 할당된 장치에 직접 명령을 실행합니다.
매개변수 | |
---|---|
listener | ICommandScheduler.IScheduledInvocationListener : 알림을 받을 ICommandScheduler.IScheduledInvocationListener |
devices | ERROR(/List ) 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 |
가입하다
public abstract void join (long millis)
스케줄러가 밀리초 단위로 지정된 기간 후에 완료되거나 시간 초과될 때까지 기다립니다.
매개변수 | |
---|---|
millis | long |
또한보십시오:
제거모든 명령
public abstract void removeAllCommands ()
스케줄러에서 모든 명령 제거
setClearcutClient
public abstract void setClearcutClient (ClearcutClient client)
하네스 데이터를 보고하도록 클라이언트 설정
매개변수 | |
---|---|
client | ClearcutClient |
ShutdownOnCmdfileError가 발생해야 합니다.
public abstract boolean shouldShutdownOnCmdfileError ()
명령 오류로 인해 스케줄러를 종료해야 하는 경우 true를 반환합니다.
보고 | |
---|---|
boolean |
일시 휴업
public void shutdown ()
명령 스케줄러를 정상적으로 종료해 보십시오.
테스트 대기 중인 명령을 지우고 진행 중인 모든 호출이 정상적으로 종료되도록 요청합니다.
종료가 호출된 후 스케줄러 메인 루프는 완전히 종료되기 전에 진행 중인 모든 호출이 완료될 때까지 기다립니다.
일시 휴업
public abstract void shutdown (boolean notifyStop)
명령 스케줄러를 정상적으로 종료해 보십시오.
매개변수 | |
---|---|
notifyStop | boolean : true인 경우 TF 종료 호출을 알립니다. |
종료하드
public abstract void shutdownHard (boolean killAdb)
명령 스케줄러를 강제로 종료해 보십시오.
shutdown()
과 유사하지만 더 빠르게 완료하기 위해 진행 중인 호출을 '고취'하기 위해 선택적으로 adb 연결을 종료합니다.
매개변수 | |
---|---|
killAdb | boolean |
종료하드
public abstract void shutdownHard ()
명령 스케줄러를 강제로 종료해 보십시오. shutdownHard(true)와 동일합니다.
종료시 비어 있음
public abstract void shutdownOnEmpty ()
shutdown()
과 유사하지만, 대신 종료하기 전에 모든 명령이 실행될 때까지 기다립니다.
시작
public abstract void start ()
ICommandScheduler
시작합니다.
shutdown()
이 호출될 때까지 실행됩니다. Thread.start()
참조하세요. 중지 호출
public abstract boolean stopInvocation (int invocationId, String cause)
ID를 지정하여 실행 중인 호출을 중지합니다.
매개변수 | |
---|---|
invocationId | int : 호출의 추적 ID입니다. |
cause | String : 호출을 중지하는 원인입니다. |
보고 | |
---|---|
boolean | 호출이 중지되었으면 true, 그렇지 않으면 false |
던지기 | |
---|---|
UnsupportedOperationException | 구현이 이를 지원하지 않는 경우 |
중지 호출
public boolean stopInvocation (int invocationId)
ID를 지정하여 실행 중인 호출을 중지합니다.
매개변수 | |
---|---|
invocationId | int |
보고 | |
---|---|
boolean | 호출이 중지되었으면 true, 그렇지 않으면 false |
던지기 | |
---|---|
UnsupportedOperationException | 구현이 이를 지원하지 않는 경우 |
중지 호출
public abstract boolean stopInvocation (ITestInvocation invocation)
실행 중인 호출을 중지합니다.
매개변수 | |
---|---|
invocation | ITestInvocation |
보고 | |
---|---|
boolean | 호출이 중지되었으면 true, 그렇지 않으면 false |
던지기 | |
---|---|
UnsupportedOperationException | 구현이 이를 지원하지 않는 경우 |
stop스케줄링
public void stopScheduling ()
새 테스트 예약 및 수락을 중지하지만 Tradefed를 중지하지는 않습니다. 이는 먼저 실행 중인 모든 테스트를 비운 다음 Tradefed 프로세스를 종료하는 2단계 종료를 활성화하기 위한 것입니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2023-10-14(UTC)