Package org.apache.commons.exec

# Class Watchdog.Builder

java.lang.Object
org.apache.commons.exec.Watchdog.Builder

All Implemented Interfaces:
  `Supplier<Watchdog>`

Enclosing class:
  Watchdog

public static final class Watchdog.Builder extends Object implements Supplier<Watchdog>
Builds ExecuteWatchdog instances.

Since:
  1.4.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Watchdog`
  `get()`
  Creates a new configured ExecuteWatchdog.
  `Watchdog.Builder`
  `setThreadFactory(ThreadFactory threadFactory)`
  Sets the thread factory.
  `Watchdog.Builder`
  `setTimeout(Duration timeout)`
  Sets the timeout duration.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()
    Constructs a new instance.

- ## Method Details

  - ### get

    public Watchdog get()
    Creates a new configured ExecuteWatchdog.
    Specified by:
      `get` in interface `Supplier<Watchdog>`
    Returns:
      a new configured ExecuteWatchdog.

  - ### setThreadFactory

    public Watchdog.Builder setThreadFactory(ThreadFactory threadFactory)
    Sets the thread factory.
    Parameters:
      `threadFactory` - the thread factory, null resets to the default `Executors.defaultThreadFactory()`.
    Returns:
      `this` instance.

  - ### setTimeout

    public Watchdog.Builder setTimeout(Duration timeout)
    Sets the timeout duration.
    Parameters:
      `timeout` - the timeout duration, null resets to the default 30 seconds timeout.
    Returns:
      `this` instance.