Package org.apache.commons.exec
Class Watchdog.Builder
- java.lang.Object
-
- org.apache.commons.exec.Watchdog.Builder
-
- All Implemented Interfaces:
java.util.function.Supplier<Watchdog>
- Enclosing class:
- Watchdog
public static final class Watchdog.Builder extends java.lang.Object implements java.util.function.Supplier<Watchdog>
Builds ExecuteWatchdog instances.- Since:
- 1.4.0
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Watchdogget()Creates a new configured ExecuteWatchdog.Watchdog.BuildersetThreadFactory(java.util.concurrent.ThreadFactory threadFactory)Sets the thread factory.Watchdog.BuildersetTimeout(java.time.Duration timeout)Sets the timeout duration.
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructs a new instance.
-
-
Method Detail
-
get
public Watchdog get()
Creates a new configured ExecuteWatchdog.- Specified by:
getin interfacejava.util.function.Supplier<Watchdog>- Returns:
- a new configured ExecuteWatchdog.
-
setThreadFactory
public Watchdog.Builder setThreadFactory(java.util.concurrent.ThreadFactory threadFactory)
Sets the thread factory.- Parameters:
threadFactory- the thread factory, null resets to the defaultExecutors.defaultThreadFactory().- Returns:
thisinstance.
-
setTimeout
public Watchdog.Builder setTimeout(java.time.Duration timeout)
Sets the timeout duration.- Parameters:
timeout- the timeout duration, null resets to the default 30 seconds timeout.- Returns:
thisinstance.
-
-