public class DefaultExecuteResultHandler extends Object implements ExecuteResultHandler
Constructor and Description |
---|
DefaultExecuteResultHandler()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ExecuteException |
getException()
Get the
exception causing the process execution to fail. |
int |
getExitValue()
Get the
exitValue of the process. |
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.
|
public DefaultExecuteResultHandler()
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.IllegalStateException
- if the process has not exited yetpublic int getExitValue()
exitValue
of the process.IllegalStateException
- if the process has not exited yetpublic 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 millisecondsInterruptedException
- if the current thread is
interrupted by another
thread while it is waiting, then the wait is ended and
an InterruptedException
is thrown.Copyright © 2014 The Apache Software Foundation. All rights reserved.