Package io.helidon.config
Class PollingStrategies.ScheduledBuilder
- java.lang.Object
-
- io.helidon.config.PollingStrategies.ScheduledBuilder
-
- All Implemented Interfaces:
Builder<PollingStrategy>
,Supplier<PollingStrategy>
- Enclosing class:
- PollingStrategies
public static final class PollingStrategies.ScheduledBuilder extends Object implements Builder<PollingStrategy>
A builder for a scheduled polling strategy.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PollingStrategy
build()
Builds a new polling strategy.static PollingStrategies.ScheduledBuilder
create(Config metaConfig)
Initializes polling strategy instance from configuration properties.PollingStrategies.ScheduledBuilder
executor(ScheduledExecutorService executor)
Sets a customservice
used to schedule polling ticks on.PollingStrategy
get()
-
-
-
Method Detail
-
create
public static PollingStrategies.ScheduledBuilder create(Config metaConfig) throws ConfigMappingException, MissingValueException
Initializes polling strategy instance from configuration properties.Mandatory
properties
, seePollingStrategies.regular(Duration)
:interval
- typeDuration
, e.g.PT15S
means 15 seconds
- Parameters:
metaConfig
- meta-configuration used to initialize returned polling strategy builder instance from.- Returns:
- new instance of polling strategy builder described by
metaConfig
- Throws:
MissingValueException
- in case the configuration tree does not contain all expected sub-nodes required by the mapper implementation to provide instance of Java type.ConfigMappingException
- in case the mapper fails to map the (existing) configuration tree represented by the supplied configuration node to an instance of a given Java type.- See Also:
PollingStrategies.regular(Duration)
-
executor
public PollingStrategies.ScheduledBuilder executor(ScheduledExecutorService executor)
Sets a customservice
used to schedule polling ticks on.By default it is a new thread pool executor per polling strategy instance.
- Parameters:
executor
- the custom scheduled executor service- Returns:
- a modified builder instance
-
build
public PollingStrategy build()
Builds a new polling strategy.- Specified by:
build
in interfaceBuilder<PollingStrategy>
- Returns:
- the new instance
-
get
public PollingStrategy get()
- Specified by:
get
in interfaceBuilder<PollingStrategy>
- Specified by:
get
in interfaceSupplier<PollingStrategy>
-
-