|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.exec.DefaultExecuteResultHandler
public class DefaultExecuteResultHandler
A default implementation of 'ExecuteResultHandler' used for asynchronous process handling.
| Constructor Summary | |
|---|---|
DefaultExecuteResultHandler()
Constructor. |
|
| Method Summary | |
|---|---|
ExecuteException |
getException()
Get the exception |
int |
getExitValue()
Get the exitValue |
boolean |
hasResult()
Has the process exited and a result is available, i.e. |
void |
onProcessComplete(int exitValue)
The asynchronous execution completed. |
void |
onProcessFailed(ExecuteException e)
The asynchronous execution failed. |
void |
waitFor()
Causes the current thread to wait, if necessary, until the process has terminated. |
void |
waitFor(long timeout)
Causes the current thread to wait, if necessary, until the process has terminated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultExecuteResultHandler()
| Method Detail |
|---|
public void onProcessComplete(int exitValue)
ExecuteResultHandler
onProcessComplete in interface ExecuteResultHandlerexitValue - the exit value of the sub-processExecuteResultHandler.onProcessComplete(int)public void onProcessFailed(ExecuteException e)
ExecuteResultHandler
onProcessFailed in interface ExecuteResultHandlere - the ExecuteException containing the root causeExecuteResultHandler.onProcessFailed(org.apache.commons.exec.ExecuteException)public ExecuteException getException()
exception causing the process execution to fail.
- Returns:
- Returns the exception.
- Throws:
IllegalStateException - if the process has not exited yet
public int getExitValue()
exitValue of the process.
- Returns:
- Returns the exitValue.
- Throws:
IllegalStateException - if the process has not exited yet
public boolean hasResult()
public void waitFor()
throws InterruptedException
InterruptedException - if the current thread is
interrupted by another
thread while it is waiting, then the wait is ended and
an InterruptedException is thrown.
public void waitFor(long timeout)
throws InterruptedException
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
an InterruptedException is thrown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||