Package io.helidon.common.configurable
Class ScheduledThreadPoolSupplier
java.lang.Object
io.helidon.common.configurable.ScheduledThreadPoolSupplier
- All Implemented Interfaces:
RuntimeType.Api<ScheduledThreadPoolConfig>
,Supplier<ScheduledExecutorService>
public final class ScheduledThreadPoolSupplier
extends Object
implements Supplier<ScheduledExecutorService>, RuntimeType.Api<ScheduledThreadPoolConfig>
Supplier of a custom scheduled thread pool.
The returned thread pool supports
Context
propagation.-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a new fluent API builder to build thread pool supplier.int
Returns size of core pool.static ScheduledThreadPoolSupplier
create()
Create a new thread pool supplier with default configuration.static ScheduledThreadPoolSupplier
Load supplier from configuration.static ScheduledThreadPoolSupplier
create
(ScheduledThreadPoolConfig config) Create a new instance from programmatic configuration.static ScheduledThreadPoolSupplier
create
(Consumer<ScheduledThreadPoolConfig.Builder> consumer) Create a new instance customizing its configuration.get()
The prototype as it was received when creating this runtime object instance.
-
Method Details
-
builder
Create a new fluent API builder to build thread pool supplier.- Returns:
- a builder instance
-
create
Load supplier from configuration.- Parameters:
config
- config instance- Returns:
- a new thread pool supplier configured from config
-
create
Create a new thread pool supplier with default configuration.- Returns:
- a new thread pool supplier with default configuration
-
create
Create a new instance from programmatic configuration.- Parameters:
config
- configuration- Returns:
- a new thread pool supplier
-
create
public static ScheduledThreadPoolSupplier create(Consumer<ScheduledThreadPoolConfig.Builder> consumer) Create a new instance customizing its configuration.- Parameters:
consumer
- configuration consumer- Returns:
- a new thread pool supplier
-
prototype
Description copied from interface:RuntimeType.Api
The prototype as it was received when creating this runtime object instance.- Specified by:
prototype
in interfaceRuntimeType.Api<ScheduledThreadPoolConfig>
- Returns:
- prototype object used to create this instance
-
corePoolSize
public int corePoolSize()Returns size of core pool.- Returns:
- size of core pool.
-
get
- Specified by:
get
in interfaceSupplier<ScheduledExecutorService>
-