Package io.helidon.common.configurable
Class ThreadPoolSupplier
- java.lang.Object
-
- io.helidon.common.configurable.ThreadPoolSupplier
-
- All Implemented Interfaces:
Supplier<ExecutorService>
public final class ThreadPoolSupplier extends Object implements Supplier<ExecutorService>
Supplier of a custom thread pool. The returned thread pool supportsContext
propagation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThreadPoolSupplier.Builder
A fluent API builder forThreadPoolSupplier
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ThreadPoolSupplier.Builder
builder()
Create a new fluent API builder to build thread pool supplier.int
corePoolSize()
Returns size of core pool.static ThreadPoolSupplier
create()
Deprecated, for removal: This API element is subject to removal in a future version.since 2.4.2, please usecreate(String)
static ThreadPoolSupplier
create(Config config)
Deprecated, for removal: This API element is subject to removal in a future version.since 2.4.2, please usecreate(Config, String)
static ThreadPoolSupplier
create(Config config, String name)
Load supplier from configuration.static ThreadPoolSupplier
create(String name)
Create a new thread pool supplier with default configuration and a given name.ExecutorService
get()
-
-
-
Method Detail
-
builder
public static ThreadPoolSupplier.Builder builder()
Create a new fluent API builder to build thread pool supplier.- Returns:
- a builder instance
-
create
@Deprecated(since="2.4.2", forRemoval=true) public static ThreadPoolSupplier create(Config config)
Deprecated, for removal: This API element is subject to removal in a future version.since 2.4.2, please usecreate(Config, String)
Load supplier from configuration.- Parameters:
config
- config instance- Returns:
- a new thread pool supplier configured from config
-
create
public static ThreadPoolSupplier create(Config config, String name)
Load supplier from configuration.- Parameters:
config
- config instancename
- thread pool name- Returns:
- a new thread pool supplier configured from config
-
create
@Deprecated(since="2.4.2", forRemoval=true) public static ThreadPoolSupplier create()
Deprecated, for removal: This API element is subject to removal in a future version.since 2.4.2, please usecreate(String)
Create a new thread pool supplier with default configuration.- Returns:
- a new thread pool supplier with default configuration
-
create
public static ThreadPoolSupplier create(String name)
Create a new thread pool supplier with default configuration and a given name.- Parameters:
name
- thread pool name- Returns:
- a new thread pool supplier with default configuration
-
get
public ExecutorService get()
- Specified by:
get
in interfaceSupplier<ExecutorService>
-
corePoolSize
public int corePoolSize()
Returns size of core pool.- Returns:
- size of core pool.
-
-