public class ProcessAwaitExecutor extends BaseProcessExecutor
| Modifier and Type | Field and Description |
|---|---|
protected Runnable |
callback
执行完毕回调
|
protected ExecutorService |
scheduler
pool
|
addEnv, command, dir, env, redirectError, removeEnv| Constructor and Description |
|---|
ProcessAwaitExecutor(String command) |
ProcessAwaitExecutor(String[] command) |
ProcessAwaitExecutor(String[] command,
String dir) |
ProcessAwaitExecutor(String command,
String dir) |
addEnv, addEnv, dir, getAddEnv, getCommand, getDir, getEnv, getTerminalCommand, redirectError, removeEnv, removeEnv, terminal, toStringprotected Runnable callback
protected ExecutorService scheduler
public ProcessAwaitExecutor(String command)
public ProcessAwaitExecutor(String[] command)
public ProcessAwaitExecutor inherit()
public ProcessAwaitExecutor waitFor()
public ProcessAwaitExecutor waitFor(long timeout)
timeout - 超时时间public ProcessAwaitExecutor sync()
public ProcessAwaitExecutor streamHandler(Consumer<InputStream> streamHandler)
streamHandler - 标准输出流处理器public ProcessAwaitExecutor errorStreamHandler(Consumer<InputStream> errorStreamHandler)
errorStreamHandler - 错误输出流处理器public ProcessAwaitExecutor scheduler(ExecutorService scheduler)
scheduler - poolpublic ProcessAwaitExecutor callback(Runnable callback)
callback - 回调方法public ProcessAwaitExecutor write(String command)
command - commandpublic ProcessAwaitExecutor writeLine(String command)
command - commandpublic ProcessAwaitExecutor write(String command, String charset)
command - commandcharset - 编码格式public ProcessAwaitExecutor writeLine(String command, String charset)
command - commandcharset - 编码格式public ProcessAwaitExecutor write(byte[] command)
command - commandpublic ProcessAwaitExecutor write(byte[] command, boolean lf)
command - commandlf - 是否键入 \npublic ProcessAwaitExecutor interrupt()
public ProcessAwaitExecutor exit()
public void exec()
Executablepublic void close()
BaseProcessExecutorclose in interface SafeCloseableclose in interface Closeableclose in interface AutoCloseableclose in class BaseProcessExecutorpublic boolean isAlive()
isAlive in class BaseProcessExecutorpublic int getExitCode()
getExitCode in class BaseProcessExecutorpublic Process getProcess()
BaseProcessExecutorgetProcess in class BaseProcessExecutorpublic ProcessBuilder getProcessBuilder()
BaseProcessExecutorgetProcessBuilder in class BaseProcessExecutorpublic InputStream getInputStream()
public InputStream getErrorStream()
public OutputStream getOutputStream()
public boolean isInherit()
public long getWaitFor()
public boolean isDone()
public boolean isClose()
Copyright © 2025. All rights reserved.