Package org.apache.commons.exec
Class Watchdog
java.lang.Object
org.apache.commons.exec.Watchdog
- All Implemented Interfaces:
Runnable
Generalization of
ExecuteWatchdog
.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builds ExecuteWatchdog instances. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a TimeoutObserver.static Watchdog.Builder
builder()
Creates a new builder.protected final void
Fires a timeout occurred event for each observer.void
Removes a TimeoutObserver.void
run()
void
start()
Starts a new thread.void
stop()
Requests a thread stop.
-
Constructor Details
-
Watchdog
Deprecated.Constructs a new instance.- Parameters:
timeoutMillis
- the timeout duration.
-
-
Method Details
-
builder
Creates a new builder.- Returns:
- a new builder.
- Since:
- 1.4.0
-
addTimeoutObserver
Adds a TimeoutObserver.- Parameters:
to
- a TimeoutObserver to add.
-
fireTimeoutOccured
Fires a timeout occurred event for each observer. -
removeTimeoutObserver
Removes a TimeoutObserver.- Parameters:
to
- a TimeoutObserver to remove.
-
run
-
start
Starts a new thread. -
stop
Requests a thread stop.
-
Watchdog.Builder.get()
.