Class ThreadPoolConfig.Builder
java.lang.Object
io.helidon.common.configurable.ThreadPoolConfig.BuilderBase<ThreadPoolConfig.Builder, ThreadPoolConfig>
io.helidon.common.configurable.ThreadPoolConfig.Builder
- All Implemented Interfaces:
Prototype.Builder<ThreadPoolConfig.Builder, ThreadPoolConfig>, Builder<ThreadPoolConfig.Builder, ThreadPoolSupplier>, ConfigBuilderSupport.ConfiguredBuilder<ThreadPoolConfig.Builder, ThreadPoolConfig>, Supplier<ThreadPoolSupplier>
- Enclosing interface:
ThreadPoolConfig
public static class ThreadPoolConfig.Builder
extends ThreadPoolConfig.BuilderBase<ThreadPoolConfig.Builder, ThreadPoolConfig>
implements Builder<ThreadPoolConfig.Builder, ThreadPoolSupplier>
Fluent API builder for
ThreadPoolSupplier.-
Nested Class Summary
Nested classes/interfaces inherited from class ThreadPoolConfig.BuilderBase
ThreadPoolConfig.BuilderBase.ThreadPoolConfigImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create an instance from this builder.Create an instance of the prototype.Methods inherited from class ThreadPoolConfig.BuilderBase
clearName, clearThreadNamePrefix, config, config, corePoolSize, corePoolSize, daemon, daemon, from, from, growthRate, growthRate, growthThreshold, growthThreshold, keepAlive, keepAlive, maxPoolSize, maxPoolSize, name, name, preBuildPrototype, queueCapacity, queueCapacity, rejectionHandler, rejectionHandler, shouldPrestart, shouldPrestart, threadNamePrefix, threadNamePrefix, toString, validatePrototype, virtualThreads, virtualThreadsModifier and TypeMethodDescriptionClear existing value of name.Clear existing value of threadNamePrefix.config()Configuration used to configure this instance.Update builder from configuration (node of this type).intCore pool size of the thread pool executor.corePoolSize(int corePoolSize) Core pool size of the thread pool executor.booleandaemon()Is daemon of the thread pool executor.daemon(boolean daemon) Is daemon of the thread pool executor.from(ThreadPoolConfig prototype) Update this builder from an existing prototype instance.from(ThreadPoolConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.intThe percentage of task submissions that should result in adding threads, expressed as a value from 1 to 100.growthRate(int growthRate) The percentage of task submissions that should result in adding threads, expressed as a value from 1 to 100.intThe queue size above which pool growth will be considered if the pool is not fixed size.growthThreshold(int growthThreshold) The queue size above which pool growth will be considered if the pool is not fixed size.Keep alive of the thread pool executor.Keep alive of the thread pool executor.intMax pool size of the thread pool executor.maxPoolSize(int maxPoolSize) Max pool size of the thread pool executor.name()Name of this thread pool executor.Name of this thread pool executor.protected voidHandles providers and decorators.intQueue capacity of the thread pool executor.queueCapacity(int queueCapacity) Queue capacity of the thread pool executor.Rejection policy of the thread pool executor.rejectionHandler(ThreadPool.RejectionHandler rejectionHandler) Rejection policy of the thread pool executor.booleanWhether to prestart core threads in this thread pool executor.shouldPrestart(boolean shouldPrestart) Whether to prestart core threads in this thread pool executor.Name prefix for threads in this thread pool executor.threadNamePrefix(String threadNamePrefix) Name prefix for threads in this thread pool executor.toString()protected voidValidates required properties.booleanWhen configured totrue, an unbounded virtual executor service (project Loom) will be used.virtualThreads(boolean virtualThreads) When configured totrue, an unbounded virtual executor service (project Loom) will be used.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault ThreadPoolSupplierget()default ThreadPoolConfig.Builderidentity()Instance of this builder as the correct type.default ThreadPoolConfig.Builderupdate(Consumer<ThreadPoolConfig.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface Prototype.Builder
selfModifier and TypeMethodDescriptiondefault ThreadPoolConfig.Builderself()Instance of this builder as the correct type.
-
Method Details
-
buildPrototype
Create an instance of the prototype. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildPrototypein interfacePrototype.Builder<ThreadPoolConfig.Builder, ThreadPoolConfig>- Returns:
- an instance of the setup object created from this builder
-
build
Create an instance from this builder. Calling this method may update this builder from providers and decorators, so repeated calls may have side effects.- Specified by:
buildin interfaceBuilder<ThreadPoolConfig.Builder, ThreadPoolSupplier>- Returns:
- instance of the built type
-