IRunUtil
public interface IRunUtil
com.android.tradefed.util.IRunUtil |
시간 제한 작업 및 시스템 명령을 실행하기 위한 인터페이스입니다.
요약
중첩 클래스 | |
---|---|
interface | IRunUtil.IRunnableResult 부울 상태를 반환하는 작업을 비동기적으로 실행하기 위한 인터페이스입니다. |
공개 메소드 | |
---|---|
abstract void | allowInterrupt (boolean allow) 현재 스레드에서 실행 인터럽트를 허용/허용하지 않습니다. |
abstract void | interrupt (Thread thread, String message, ErrorIdentifier errorId) 지정된 스레드에서 진행 중이거나 향후 실행 작업을 중단합니다. |
abstract void | interrupt (Thread thread, String message) 지정된 스레드에서 진행 중이거나 향후 실행 작업을 중단합니다. |
abstract boolean | isInterruptAllowed () RunUtil의 인터럽트 상태를 제공합니다. |
abstract Process | runCmdInBackground (Redirect redirect, command) runCmdInBackground (Redirect redirect, command) |
abstract Process | runCmdInBackground ( command) runCmdInBackground ( command) |
abstract Process | runCmdInBackground ( command, OutputStream output) runCmdInBackground ( command, OutputStream output) |
abstract Process | runCmdInBackground (String... command) 시스템 명령을 비동기적으로 실행하는 도우미 메서드입니다. |
abstract Process | runCmdInBackground (Redirect redirect, String... command) 시스템 명령을 비동기적으로 실행하는 도우미 메서드입니다. |
abstract boolean | runEscalatingTimedRetry (long opTimeout, long initialPollInterval, long maxPollInterval, long maxTime, IRunUtil.IRunnableResult runnable) 성공할 때까지 작업을 여러 번 차단하고 실행합니다. |
abstract boolean | runFixedTimedRetry (long opTimeout, long pollInterval, long maxTime, IRunUtil.IRunnableResult runnable) 성공할 때까지 작업을 여러 번 차단하고 실행합니다. |
abstract boolean | runFixedTimedRetryWithOutputMonitor (long opTimeout, long idleOutputTimeout, long pollInterval, long maxTime, IRunUtil.IRunnableResult runnable) 성공할 때까지 작업을 여러 번 차단하고 실행합니다. |
abstract CommandStatus | runTimed (long timeout, IRunUtil.IRunnableResult runnable, boolean logErrors) 작업을 차단하고 실행하며, 지정된 시간보다 오래 걸리면 중단합니다. |
abstract CommandResult | runTimedCmd (long timeout, OutputStream stdout, OutputStream stderr, String... command) 시스템 명령을 실행하고, 지정된 시간보다 오래 걸리면 중단하고, 지정된 경우 출력을 파일로 리디렉션하는 도우미 메서드입니다. |
abstract CommandResult | runTimedCmd (long timeout, String... command) 시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 메서드입니다. |
abstract CommandResult | runTimedCmdRetry (long timeout, long retryInterval, int attempts, String... command) 시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 방법입니다. |
abstract CommandResult | runTimedCmdRetryWithOutputMonitor (long timeout, long idleOutputTimeout, long retryInterval, int attempts, String... command) 시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 방법입니다. |
abstract CommandResult | runTimedCmdSilently (long timeout, String... command) 시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 방법입니다. |
abstract CommandResult | runTimedCmdSilentlyRetry (long timeout, long retryInterval, int attempts, String... command) 시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 방법입니다. |
abstract CommandResult | runTimedCmdWithInput (long timeout, String input, File stdoutFile, File stderrFile, String... command) 시스템 명령을 실행하고, 지정된 시간보다 오래 걸리면 중단하고, 지정된 경우 출력을 파일로 리디렉션하는 도우미 메서드입니다. |
abstract CommandResult | runTimedCmdWithInput (long timeout, String input, String... command) stdin 입력이 필요한 시스템 명령을 실행하고, 지정된 시간보다 오래 걸릴 경우 중단하는 도우미 메서드입니다. |
abstract CommandResult | runTimedCmdWithInput (long timeout, String input, command) runTimedCmdWithInput (long timeout, String input, command) stdin 입력이 필요한 시스템 명령을 실행하고, 지정된 시간보다 오래 걸릴 경우 중단하는 도우미 메서드입니다. |
abstract CommandResult | runTimedCmdWithInputRedirect (long timeout, File inputRedirect, String... command) 파일에서 Stdin을 리디렉션하고 지정된 시간보다 오래 걸리는 경우 중단해야 하는 시스템 명령을 실행하는 도우미 메서드입니다. |
abstract CommandResult | runTimedCmdWithOutputMonitor (long timeout, long idleOutputTimeout, OutputStream stdout, OutputStream stderr, String... command) 시스템 명령을 실행하고, 지정된 시간보다 오래 걸리면 중단하고, 지정된 경우 출력을 파일로 리디렉션하는 도우미 메서드입니다. |
abstract CommandResult | runTimedCmdWithOutputMonitor (long timeout, long idleOutputTimeout, String... command) 시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 방법입니다. |
abstract boolean | runTimedRetry (long opTimeout, long pollInterval, int attempts, IRunUtil.IRunnableResult runnable) 성공할 때까지 작업을 여러 번 차단하고 실행합니다. |
abstract boolean | runTimedRetryWithOutputMonitor (long opTimeout, long idleOutputTimeout, long pollInterval, int attempts, IRunUtil.IRunnableResult runnable) 성공할 때까지 작업을 여러 번 차단하고 실행합니다. |
abstract CommandStatus | runTimedWithOutputMonitor (long timeout, long idleOutputTimeout, IRunUtil.IRunnableResult runnable, boolean logErrors) 작업을 차단하고 실행하며, 지정된 시간보다 오래 걸리면 중단합니다. |
abstract void | setEnvVariable (String key, String value) 시스템 명령을 실행할 때 사용할 환경 변수를 설정합니다. |
abstract void | setEnvVariablePriority ( IRunUtil.EnvPriority priority) 프로세스를 생성할 때 환경 변수를 설정하는 것보다 설정하지 않는 것이 우선순위인지 여부를 결정합니다. |
abstract void | setInterruptibleInFuture (Thread thread, long timeMs) 약간의 대기 시간이 지나면 중단 가능으로 설정됩니다. |
abstract void | setLinuxInterruptProcess (boolean interrupt) 시간 초과에 도달하면 #runTimed 메서드를 통해 실행 중인 프로세스에서 Linux 'kill' 중단을 사용할 수 있습니다. |
abstract void | setRedirectStderrToStdout (boolean redirect) 시스템 명령을 실행할 때 표준 출력 스트림으로 리디렉션되도록 표준 오류 스트림을 설정합니다. |
abstract void | setWorkingDir (File dir) 시스템 명령에 대한 작업 디렉터리를 설정합니다. |
abstract void | sleep (long time) 예외를 무시하고 지정된 시간 동안 잠을 자는 도우미 메서드입니다. |
abstract void | unsetEnvVariable (String key) 환경 변수를 설정 해제하여 시스템 명령이 이 환경 변수 없이 실행되도록 합니다. |
공개 메소드
인터럽트 허용
public abstract void allowInterrupt (boolean allow)
현재 스레드에서 실행 인터럽트를 허용/허용하지 않습니다. 허용되는 경우 현재 스레드의 실행 작업은 interrupt(Thread, String)
메서드를 통해 다른 스레드에서 중단될 수 있습니다.
매개변수 | |
---|---|
allow | boolean : 현재 스레드에서 실행 인터럽트를 허용할지 여부입니다. |
방해하다
public abstract void interrupt (Thread thread, String message, ErrorIdentifier errorId)
지정된 스레드에서 진행 중이거나 향후 실행 작업을 중단합니다. 지정된 스레드의 실행 작업은 RunInterruptedException
발생시킵니다.
매개변수 | |
---|---|
message | String : RunInterruptedException 에 대한 메시지입니다. |
errorId | ErrorIdentifier : 알려진 경우 중단 원인을 나타냅니다. |
방해하다
public abstract void interrupt (Thread thread, String message)
지정된 스레드에서 진행 중이거나 향후 실행 작업을 중단합니다. 지정된 스레드의 실행 작업은 RunInterruptedException
발생시킵니다.
매개변수 | |
---|---|
message | String : RunInterruptedException 에 대한 메시지입니다. |
인터럽트가 허용됨
public abstract boolean isInterruptAllowed ()
RunUtil의 인터럽트 상태를 제공합니다.
보고 | |
---|---|
boolean | 실행을 중단할 수 있으면 true이고, 그렇지 않으면 false입니다. |
runCmdIn백그라운드
public abstract Process runCmdInBackground (Redirect redirect,command)
ERROR(/List)
형식의 명령 인수를 허용하는 대체 runCmdInBackground(String)
메서드입니다.
매개변수 | |
---|---|
redirect | Redirect : ProcessBuilder 에 적용할 ERROR(/Redirect) . |
command | ERROR(/List) |
보고 | |
---|---|
Process | 실행된 명령의 Process |
던지기 | |
---|---|
| 명령 실행에 실패한 경우 |
runCmdIn백그라운드
public abstract Process runCmdInBackground (command)
ERROR(/List)
형식의 명령 인수를 허용하는 대체 runCmdInBackground(String)
메서드입니다.
매개변수 | |
---|---|
command | ERROR(/List) |
보고 | |
---|---|
Process | 실행된 명령의 Process |
던지기 | |
---|---|
| 명령 실행에 실패한 경우 |
runCmdIn백그라운드
public abstract Process runCmdInBackground (command, OutputStream output)
ERROR(/OutputStream)
사용하여 명령을 실행하면 명령의 출력이 기록됩니다. Stdout과 stderr은 함께 병합됩니다.
매개변수 | |
---|---|
command | |
output | OutputStream : 출력을 저장할 OutputStream |
보고 | |
---|---|
Process | 명령을 실행하는 Process |
던지기 | |
---|---|
| IO예외 |
runCmdIn백그라운드
public abstract Process runCmdInBackground (String... command)
시스템 명령을 비동기적으로 실행하는 도우미 메서드입니다.
명령을 실행한 후 즉시 반환됩니다.
매개변수 | |
---|---|
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
Process | 실행된 명령의 Process |
던지기 | |
---|---|
| 명령 실행에 실패한 경우 |
runCmdIn백그라운드
public abstract Process runCmdInBackground (Redirect redirect, String... command)
시스템 명령을 비동기적으로 실행하는 도우미 메서드입니다.
명령을 실행한 후 즉시 반환됩니다.
매개변수 | |
---|---|
redirect | Redirect : ProcessBuilder 에 적용할 ERROR(/Redirect) . |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
Process | 실행된 명령의 Process |
던지기 | |
---|---|
| 명령 실행에 실패한 경우 |
runEscalatingTimed재시도
public abstract boolean runEscalatingTimedRetry (long opTimeout, long initialPollInterval, long maxPollInterval, long maxTime, IRunUtil.IRunnableResult runnable)
성공할 때까지 작업을 여러 번 차단하고 실행합니다.
작업 시도 사이의 대기 시간을 기하급수적으로 늘립니다. 이는 서버 폴링과 같은 작업을 수행할 때 일시적으로 다운되는 경우 복구할 시간을 주기 위해 사용하기 위한 것입니다.매개변수 | |
---|---|
opTimeout | long : 단일 작업 시도를 기다리는 최대 시간(ms) |
initialPollInterval | long : 작업 시도 사이에 대기하는 초기 시간 |
maxPollInterval | long : 작업 시도 사이에 대기하는 최대 시간 |
maxTime | long : 작업을 계속 시도하는 데 소요되는 대략적인 최대 총 시간 |
runnable | IRunUtil.IRunnableResult : 실행할 IRunUtil.IRunnableResult |
보고 | |
---|---|
boolean | maxTime이 만료되기 전에 작업이 성공적으로 완료되면 true 입니다. |
runFixedTimed재시도
public abstract boolean runFixedTimedRetry (long opTimeout, long pollInterval, long maxTime, IRunUtil.IRunnableResult runnable)
성공할 때까지 작업을 여러 번 차단하고 실행합니다.
매개변수 | |
---|---|
opTimeout | long : 단일 작업 시도를 기다리는 최대 시간(ms) |
pollInterval | long : 작업 시도 사이에 대기하는 초기 시간 |
maxTime | long : 작업을 계속 시도하는 데 소요되는 대략적인 최대 총 시간 |
runnable | IRunUtil.IRunnableResult : 실행할 IRunUtil.IRunnableResult |
보고 | |
---|---|
boolean | maxTime이 만료되기 전에 작업이 성공적으로 완료되면 true 입니다. |
runFixedTimedRetryWithOutputMonitor
public abstract boolean runFixedTimedRetryWithOutputMonitor (long opTimeout, long idleOutputTimeout, long pollInterval, long maxTime, IRunUtil.IRunnableResult runnable)
성공할 때까지 작업을 여러 번 차단하고 실행합니다. 또한 출력 스트림의 활동을 모니터링하여 지정된 시간 동안 스트림 활동이 관찰되지 않으면 중단됩니다. dleOutputTimeout이 0으로 설정되면 스트림 모니터링이 발생하지 않습니다.
매개변수 | |
---|---|
opTimeout | long : 단일 작업 시도를 기다리는 최대 시간(ms) |
idleOutputTimeout | long : 출력 스트림에서 출력을 기다리는 최대 시간(ms) |
pollInterval | long : 작업 시도 사이에 대기하는 초기 시간 |
maxTime | long : 작업을 계속 시도하는 데 소요되는 대략적인 최대 총 시간 |
runnable | IRunUtil.IRunnableResult : 실행할 IRunUtil.IRunnableResult |
보고 | |
---|---|
boolean | maxTime이 만료되기 전에 작업이 성공적으로 완료되면 true 입니다. |
실행 시간이 지정됨
public abstract CommandStatus runTimed (long timeout, IRunUtil.IRunnableResult runnable, boolean logErrors)
작업을 차단하고 실행하며, 지정된 시간보다 오래 걸리면 중단합니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms) |
runnable | IRunUtil.IRunnableResult : 실행할 IRunUtil.IRunnableResult |
logErrors | boolean : 예외 발생 시 오류를 기록할지 여부. |
보고 | |
---|---|
CommandStatus | CommandStatus 작업 결과. |
runTimedCmd
public abstract CommandResult runTimedCmd (long timeout, OutputStream stdout, OutputStream stderr, String... command)
시스템 명령을 실행하고, 지정된 시간보다 오래 걸리면 중단하고, 지정된 경우 출력을 파일로 리디렉션하는 도우미 메서드입니다. ERROR(/OutputStream)
이런 방식으로 제공되면 함수가 끝날 때 열린 상태로 유지됩니다.
매개변수 | |
---|---|
timeout | long : timeout 대기할 최대 시간(ms)입니다. 0은 시간 초과가 없음을 의미합니다. |
stdout | OutputStream : 표준 출력이 리디렉션되는 ERROR(/OutputStream) 입니다. null일 수 있습니다. |
stderr | OutputStream : 오류 출력이 리디렉션되는 ERROR(/OutputStream) 입니다. null일 수 있습니다. |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmd
public abstract CommandResult runTimedCmd (long timeout, String... command)
시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 메서드입니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms)입니다. 0은 시간 초과가 없음을 의미합니다. |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmd재시도
public abstract CommandResult runTimedCmdRetry (long timeout, long retryInterval, int attempts, String... command)
시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 메서드입니다.
매개변수 | |
---|---|
timeout | long : 각 시도에 대해 대기하는 최대 시간(ms) |
retryInterval | long : 명령 재시도 사이에 대기하는 시간 |
attempts | int : 최대 시도 횟수 |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmdRetryWithOutputMonitor
public abstract CommandResult runTimedCmdRetryWithOutputMonitor (long timeout, long idleOutputTimeout, long retryInterval, int attempts, String... command)
시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 메서드입니다. 또한 출력 스트림의 활동을 모니터링하여 지정된 시간 동안 스트림 활동이 관찰되지 않으면 중단됩니다. dleOutputTimeout이 0으로 설정되면 스트림 모니터링이 발생하지 않습니다.
매개변수 | |
---|---|
timeout | long : 각 시도에 대해 대기하는 최대 시간(ms) |
idleOutputTimeout | long : 출력 스트림에서 출력을 기다리는 최대 시간(ms) |
retryInterval | long : 명령 재시도 사이에 대기하는 시간 |
attempts | int : 최대 시도 횟수 |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmd자동으로
public abstract CommandResult runTimedCmdSilently (long timeout, String... command)
시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 방법입니다. runTimedCmd(long, String)
과 유사하지만 예외 시 오류를 기록하지 않습니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms) |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmd자동으로재시도
public abstract CommandResult runTimedCmdSilentlyRetry (long timeout, long retryInterval, int attempts, String... command)
시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 방법입니다. runTimedCmdRetry(long, long, int, String[])
와 유사하지만 예외 시 오류를 기록하지 않습니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms) |
retryInterval | long : 명령 재시도 사이에 대기하는 시간 |
attempts | int : 최대 시도 횟수 |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmdWithInput
public abstract CommandResult runTimedCmdWithInput (long timeout, String input, File stdoutFile, File stderrFile, String... command)
시스템 명령을 실행하고, 지정된 시간보다 오래 걸리면 중단하고, 지정된 경우 출력을 파일로 리디렉션하는 도우미 메서드입니다.
매개변수 | |
---|---|
timeout | long : timeout 대기할 최대 시간(ms)입니다. 0은 시간 초과가 없음을 의미합니다. |
input | String : 프로세스에 전달할 stdin 입력 |
stdoutFile | File : 표준 출력이 리디렉션되는 ERROR(/File) 입니다. null일 수 있습니다. |
stderrFile | File : 오류 출력이 리디렉션되는 ERROR(/File) 입니다. null일 수 있습니다. |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmdWithInput
public abstract CommandResult runTimedCmdWithInput (long timeout, String input, String... command)
stdin 입력이 필요한 시스템 명령을 실행하고, 지정된 시간보다 오래 걸릴 경우 중단하는 도우미 메서드입니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms) |
input | String : 프로세스에 전달할 stdin 입력 |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmdWithInput
public abstract CommandResult runTimedCmdWithInput (long timeout, String input,command)
stdin 입력이 필요한 시스템 명령을 실행하고, 지정된 시간보다 오래 걸릴 경우 중단하는 도우미 메서드입니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms) |
input | String : 프로세스에 전달할 stdin 입력 |
command | ERROR(/List) |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmdWithInputRedirect
public abstract CommandResult runTimedCmdWithInputRedirect (long timeout, File inputRedirect, String... command)
파일에서 Stdin을 리디렉션하고 지정된 시간보다 오래 걸리는 경우 중단해야 하는 시스템 명령을 실행하는 도우미 메서드입니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms) |
inputRedirect | File : ProcessBuilder.redirectInput() 사용하여 표준 입력으로 리디렉션할 ERROR(/File) . null인 경우 stdin은 리디렉션되지 않습니다. |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmdWithOutputMonitor
public abstract CommandResult runTimedCmdWithOutputMonitor (long timeout, long idleOutputTimeout, OutputStream stdout, OutputStream stderr, String... command)
시스템 명령을 실행하고, 지정된 시간보다 오래 걸리면 중단하고, 지정된 경우 출력을 파일로 리디렉션하는 도우미 메서드입니다. ERROR(/OutputStream)
이런 방식으로 제공되면 함수가 끝날 때 열린 상태로 유지됩니다.
매개변수 | |
---|---|
timeout | long : timeout 대기할 최대 시간(ms)입니다. 0은 시간 초과가 없음을 의미합니다. |
idleOutputTimeout | long : 출력 스트림에서 출력을 기다리는 최대 시간(ms) |
stdout | OutputStream : 표준 출력이 리디렉션되는 ERROR(/OutputStream) 입니다. null일 수 있습니다. |
stderr | OutputStream : 오류 출력이 리디렉션되는 ERROR(/OutputStream) 입니다. null일 수 있습니다. |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimedCmdWithOutputMonitor
public abstract CommandResult runTimedCmdWithOutputMonitor (long timeout, long idleOutputTimeout, String... command)
시스템 명령을 실행하고 지정된 시간보다 오래 걸리면 중단하는 도우미 메서드입니다. 또한 출력 스트림의 활동을 모니터링하여 지정된 시간 동안 스트림 활동이 관찰되지 않으면 중단됩니다. dleOutputTimeout이 0으로 설정되면 스트림 모니터링이 발생하지 않습니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms)입니다. 0은 시간 초과가 없음을 의미합니다. |
idleOutputTimeout | long : 출력 스트림에서 출력을 기다리는 최대 시간(ms) |
command | String : 지정된 시스템 명령 및 선택적으로 exec에 대한 인수 |
보고 | |
---|---|
CommandResult | 명령 실행 결과를 포함하는 CommandResult |
runTimed재시도
public abstract boolean runTimedRetry (long opTimeout, long pollInterval, int attempts, IRunUtil.IRunnableResult runnable)
성공할 때까지 작업을 여러 번 차단하고 실행합니다.
매개변수 | |
---|---|
opTimeout | long : 한 번의 작업 시도를 기다리는 최대 시간(ms) |
pollInterval | long : 명령 재시도 사이에 대기하는 시간 |
attempts | int : 최대 시도 횟수 |
runnable | IRunUtil.IRunnableResult : 실행할 IRunUtil.IRunnableResult |
보고 | |
---|---|
boolean | 시도에 도달하기 전에 작업이 성공적으로 완료되면 true 입니다. |
runTimedRetryWithOutputMonitor
public abstract boolean runTimedRetryWithOutputMonitor (long opTimeout, long idleOutputTimeout, long pollInterval, int attempts, IRunUtil.IRunnableResult runnable)
성공할 때까지 작업을 여러 번 차단하고 실행합니다. 또한 출력 스트림의 활동을 모니터링하여 지정된 시간 동안 스트림 활동이 관찰되지 않으면 중단합니다. dleOutputTimeout이 0으로 설정되면 스트림 모니터링이 발생하지 않습니다.
매개변수 | |
---|---|
opTimeout | long : 한 번의 작업 시도를 기다리는 최대 시간(ms) |
idleOutputTimeout | long : 출력 스트림에서 출력을 기다리는 최대 시간(ms) |
pollInterval | long : 명령 재시도 사이에 대기하는 시간 |
attempts | int : 최대 시도 횟수 |
runnable | IRunUtil.IRunnableResult : 실행할 IRunUtil.IRunnableResult |
보고 | |
---|---|
boolean | 시도에 도달하기 전에 작업이 성공적으로 완료되면 true 입니다. |
runTimedWithOutputMonitor
public abstract CommandStatus runTimedWithOutputMonitor (long timeout, long idleOutputTimeout, IRunUtil.IRunnableResult runnable, boolean logErrors)
작업을 차단하고 실행하며, 지정된 시간보다 오래 걸리면 중단합니다. 또한 출력 스트림의 활동을 모니터링하여 지정된 시간 동안 스트림 활동이 관찰되지 않으면 중단합니다. dleOutputTimeout이 0으로 설정되면 스트림 모니터링이 발생하지 않습니다.
매개변수 | |
---|---|
timeout | long : 최대 대기 시간(ms) |
idleOutputTimeout | long : 출력 스트림에서 출력을 기다리는 최대 시간(ms) |
runnable | IRunUtil.IRunnableResult : 실행할 IRunUtil.IRunnableResult |
logErrors | boolean : 예외 발생 시 오류를 기록할지 여부. |
보고 | |
---|---|
CommandStatus | CommandStatus 작업 결과. |
setEnv변수
public abstract void setEnvVariable (String key, String value)
시스템 명령을 실행할 때 사용할 환경 변수를 설정합니다.
매개변수 | |
---|---|
key | String : 변수 이름 |
value | String : 변수 값 |
또한보십시오:
setEnvVariablePriority
public abstract void setEnvVariablePriority (IRunUtil.EnvPriority priority)
프로세스를 생성할 때 환경 변수를 설정하는 것보다 설정하지 않는 것이 우선순위인지 여부를 결정합니다. 기본적으로 설정 해제가 우선순위가 더 높습니다. 즉, 동일한 이름의 변수를 설정하려고 하면 변수가 설정 해제되므로 해당 작업이 발생하지 않습니다. 기본 IRunUtil
인스턴스에서는 사용할 수 없습니다.
매개변수 | |
---|---|
priority | IRunUtil.EnvPriority |
setInterruptibleInFuture
public abstract void setInterruptibleInFuture (Thread thread, long timeMs)
약간의 대기 시간이 지나면 중단 가능으로 설정됩니다. ERROR(/CommandScheduler#shutdownHard())
적용하여 결국 종료합니다.
매개변수 | |
---|---|
thread | Thread : 인터럽트 가능한 스레드입니다. |
timeMs | long : 인터럽트 가능을 설정하기 전에 기다리는 시간입니다. |
setLinux인터럽트프로세스
public abstract void setLinuxInterruptProcess (boolean interrupt)
시간 초과에 도달하면 #runTimed 메서드를 통해 실행 중인 프로세스에서 Linux 'kill' 중단을 사용할 수 있습니다. 기본 IRunUtil
인스턴스에서는 사용할 수 없습니다.
매개변수 | |
---|---|
interrupt | boolean |
setRedirectStderrToStdout
public abstract void setRedirectStderrToStdout (boolean redirect)
시스템 명령을 실행할 때 표준 출력 스트림으로 리디렉션되도록 표준 오류 스트림을 설정합니다. 초기값은 거짓입니다.
매개변수 | |
---|---|
redirect | boolean : 리디렉션 여부에 대한 새 값 |
setWorkingDir
public abstract void setWorkingDir (File dir)
시스템 명령에 대한 작업 디렉터리를 설정합니다.
매개변수 | |
---|---|
dir | File : 작업 디렉토리 |
또한보십시오:
잠
public abstract void sleep (long time)
예외를 무시하고 지정된 시간 동안 잠을 자는 도우미 메서드입니다.
매개변수 | |
---|---|
time | long : ms 잠자기. 0보다 작거나 같은 값은 무시됩니다. |
unsetEnv변수
public abstract void unsetEnvVariable (String key)
환경 변수를 설정 해제하여 시스템 명령이 이 환경 변수 없이 실행되도록 합니다.
매개변수 | |
---|---|
key | String : 변수 이름 |
또한보십시오:
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2023-12-04(UTC)