Package org.apache.commons.exec
Class Watchdog.Builder
- java.lang.Object
-
- org.apache.commons.exec.Watchdog.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private static java.time.DurationDEFAULT_TIMEOUTDefault timeout.private java.util.concurrent.ThreadFactorythreadFactoryThread factory.private java.time.DurationtimeoutTimeout duration.
-
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.
-
-
-
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.
-
-