Class 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.time.Duration DEFAULT_TIMEOUT
      Default timeout.
      private java.util.concurrent.ThreadFactory threadFactory
      Thread factory.
      private java.time.Duration timeout
      Timeout duration.
    • Constructor Summary

      Constructors 
      Constructor Description
      Builder()
      Constructs a new instance.
    • Field Detail

      • DEFAULT_TIMEOUT

        private static final java.time.Duration DEFAULT_TIMEOUT
        Default timeout.
      • threadFactory

        private java.util.concurrent.ThreadFactory threadFactory
        Thread factory.
      • timeout

        private java.time.Duration timeout
        Timeout duration.
    • Constructor Detail

      • Builder

        public Builder()
        Constructs a new instance.
    • Method Detail

      • get

        public Watchdog get()
        Creates a new configured ExecuteWatchdog.
        Specified by:
        get in interface java.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 default Executors.defaultThreadFactory().
        Returns:
        this instance.
      • 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:
        this instance.