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
  • Field Details

    • DEFAULT_TIMEOUT

      private static final Duration DEFAULT_TIMEOUT
      Default timeout.
    • threadFactory

      private ThreadFactory threadFactory
      Thread factory.
    • timeout

      private Duration timeout
      Timeout duration.
  • 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.