|
||||||||||
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 ExecuteResultHandler
exitValue
- the exit value of the sub-processExecuteResultHandler.onProcessComplete(int)
public void onProcessFailed(ExecuteException e)
ExecuteResultHandler
onProcessFailed
in interface ExecuteResultHandler
e
- 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:
java.lang.IllegalStateException
- if the process has not exited yet
public int getExitValue()
exitValue of the process.
- Returns:
- Returns the exitValue.
- Throws:
java.lang.IllegalStateException
- if the process has not exited yet
public boolean hasResult()
public void waitFor() throws java.lang.InterruptedException
java.lang.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 java.lang.InterruptedException
timeout
- the maximum time to wait in milliseconds
java.lang.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 |