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>, Prototype.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 Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for ScheduledThreadPoolSupplier.
  • 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

      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 Prototype.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:
      the virtual threads
    • corePoolSize

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

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

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

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

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

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

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

      protected void validatePrototype()
      Validates required properties.