类 DefaultExecuteResultHandler
java.lang.Object
com.sh.common.exec.DefaultExecuteResultHandler
- 所有已实现的接口:
ExecuteResultHandler
Description:
Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Get the exception causing the process execution to fail.intGet the exitValue of the process.booleanHas the process exited and a result is available, i.e. exitCode or exception?voidonProcessComplete(int exitValue) The asynchronous execution completed.voidThe asynchronous execution failed.voidwaitFor()Causes the current thread to wait, if necessary, until the process has terminated.voidwaitFor(long timeout) Causes the current thread to wait, if necessary, until the process has terminated.
-
构造器详细资料
-
DefaultExecuteResultHandler
public DefaultExecuteResultHandler()Constructor.
-
-
方法详细资料
-
onProcessComplete
public void onProcessComplete(int exitValue) 从接口复制的说明:ExecuteResultHandlerThe asynchronous execution completed.- 指定者:
onProcessComplete在接口中ExecuteResultHandler- 参数:
exitValue- the exit value of the sub-process- 另请参阅:
-
onProcessFailed
从接口复制的说明:ExecuteResultHandlerThe asynchronous execution failed.- 指定者:
onProcessFailed在接口中ExecuteResultHandler- 参数:
e- theExecuteExceptioncontaining the root cause- 另请参阅:
-
getException
Get the exception causing the process execution to fail.- 返回:
- Returns the exception.
- 抛出:
IllegalStateException- if the process has not exited yet
-
getExitValue
public int getExitValue()Get the exitValue of the process.- 返回:
- Returns the exitValue.
- 抛出:
IllegalStateException- if the process has not exited yet
-
hasResult
public boolean hasResult()Has the process exited and a result is available, i.e. exitCode or exception?- 返回:
- true if a result of the execution is available
-
waitFor
Causes the current thread to wait, if necessary, until the process has terminated. This method returns immediately if the process has already terminated. If the process has not yet terminated, the calling thread will be blocked until the process exits.- 抛出:
InterruptedException- if the current thread is interrupted by another thread while it is waiting, then the wait is ended and anInterruptedExceptionis thrown.
-
waitFor
Causes the current thread to wait, if necessary, until the process has terminated. This method returns immediately if the process has already terminated. If the process has not yet terminated, the calling thread will be blocked until the process exits.- 参数:
timeout- the maximum time to wait in milliseconds- 抛出:
InterruptedException- if the current thread is interrupted by another thread while it is waiting, then the wait is ended and anInterruptedExceptionis thrown.
-