Added comments
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
85ef68f6ae
commit
b9a7142c5c
@ -94,8 +94,7 @@ public final class ForwardingRunnable implements Runnable {
|
|||||||
*
|
*
|
||||||
* @throws CommandRunException if the manager was closed while writing the
|
* @throws CommandRunException if the manager was closed while writing the
|
||||||
* stream */
|
* stream */
|
||||||
private void readToEnd()
|
private void readToEnd() throws CommandRunException {
|
||||||
throws CommandRunException {
|
|
||||||
int c;
|
int c;
|
||||||
try {
|
try {
|
||||||
while ((c = is.read()) >= 0) {
|
while ((c = is.read()) >= 0) {
|
||||||
@ -145,12 +144,20 @@ public final class ForwardingRunnable implements Runnable {
|
|||||||
return connect(stream, output, "Forwarding");
|
return connect(stream, output, "Forwarding");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return the error */
|
/** Get the error in this runnable execution if any.
|
||||||
|
* <p>
|
||||||
|
* In the current implementation, this error can be an {@link IOException} if
|
||||||
|
* the input stream failed or a {@link CommandRunException} if the output was
|
||||||
|
* closed.
|
||||||
|
*
|
||||||
|
* @return the error */
|
||||||
public synchronized Exception getError() {
|
public synchronized Exception getError() {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param error the error to set */
|
/** Set the error that caused this runnable to stop executing.
|
||||||
|
*
|
||||||
|
* @param error the error to set */
|
||||||
private synchronized void setError(final Exception error) {
|
private synchronized void setError(final Exception error) {
|
||||||
this.error = error;
|
this.error = error;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user