Class ScheduledThreadPoolConfig.BuilderBase<BUILDER extends ScheduledThreadPoolConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ScheduledThreadPoolConfig>

java.lang.Object
io.helidon.common.configurable.ScheduledThreadPoolConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
ScheduledThreadPoolConfig.Builder
Enclosing interface:
ScheduledThreadPoolConfig

public abstract static class ScheduledThreadPoolConfig.BuilderBase<BUILDER extends ScheduledThreadPoolConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ScheduledThreadPoolConfig> extends Object implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for ScheduledThreadPoolConfig.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(ScheduledThreadPoolConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ScheduledThreadPoolConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      @Deprecated public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ScheduledThreadPoolConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ScheduledThreadPoolConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ScheduledThreadPoolConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ScheduledThreadPoolConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • virtualThreads

      public BUILDER virtualThreads(boolean virtualThreads)
      When configured to true, an unbounded virtual executor service (project Loom) will be used.

      If enabled, all other configuration options of this executor service are ignored!

      Parameters:
      virtualThreads - whether to use virtual threads or not, defaults to false
      Returns:
      updated builder instance
      See Also:
    • corePoolSize

      public BUILDER corePoolSize(int corePoolSize)
      Core pool size of the thread pool executor. Defaults to 16.
      Parameters:
      corePoolSize - corePoolSize see ThreadPoolExecutor.getCorePoolSize()
      Returns:
      updated builder instance
      See Also:
    • daemon

      public BUILDER daemon(boolean daemon)
      Is daemon of the thread pool executor. Defaults to true.
      Parameters:
      daemon - whether the threads are daemon threads
      Returns:
      updated builder instance
      See Also:
    • threadNamePrefix

      public BUILDER threadNamePrefix(String threadNamePrefix)
      Name prefix for threads in this thread pool executor. Defaults to "helidon-".
      Parameters:
      threadNamePrefix - prefix of a thread name
      Returns:
      updated builder instance
      See Also:
    • prestart

      public BUILDER prestart(boolean prestart)
      Whether to prestart core threads in this thread pool executor. Defaults to false.
      Parameters:
      prestart - whether to prestart the threads
      Returns:
      updated builder instance
      See Also:
    • virtualThreads

      public boolean virtualThreads()
      When configured to true, an unbounded virtual executor service (project Loom) will be used.

      If enabled, all other configuration options of this executor service are ignored!

      Returns:
      whether to use virtual threads or not, defaults to false
    • corePoolSize

      public int corePoolSize()
      Core pool size of the thread pool executor. Defaults to 16.
      Returns:
      corePoolSize see ThreadPoolExecutor.getCorePoolSize()
    • daemon

      public boolean daemon()
      Is daemon of the thread pool executor. Defaults to true.
      Returns:
      whether the threads are daemon threads
    • threadNamePrefix

      public String threadNamePrefix()
      Name prefix for threads in this thread pool executor. Defaults to "helidon-".
      Returns:
      prefix of a thread name
    • prestart

      public boolean prestart()
      Whether to prestart core threads in this thread pool executor. Defaults to false.
      Returns:
      whether to prestart the threads
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance