public interface Watchdog
The watchdog helps prevent runaway processes by implementing an internal timer which kills the running process if it is left untouched too long.
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the running process.
|
boolean |
isCanceled()
Retrieves a flag indicating whether the process has been canceled.
|
void |
resetWatchdog()
Resets the internal timer, which is used to track whether a process's handlers are idle or not and prevent
the idle timeout from terminating the process.
|
void cancel()
boolean isCanceled()
true
if the process has been canceled; otherwise, false
void resetWatchdog()
Note that the watchdog is reset automatically when a input handler
writes to the
process stdin or when the output handler
or
error handler
reads from the process stdout or stderr.
As a result, most handlers do not need to explicitly reset the watchdog. This method exists to allow
handlers, which do lengthy processing in between accessing the OutputStream
, to prevent idle timeouts
by manually resetting the watchdog.
Copyright © 2022 Atlassian. All rights reserved.