java.lang.Object
io.helidon.config.PollingStrategies.ScheduledBuilder
- All Implemented Interfaces:
Builder<PollingStrategies.ScheduledBuilder,
,PollingStrategy> Supplier<PollingStrategy>
- Enclosing class:
- PollingStrategies
public static final class PollingStrategies.ScheduledBuilder
extends Object
implements Builder<PollingStrategies.ScheduledBuilder,PollingStrategy>
A builder for a scheduled polling strategy.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new polling strategy.Initializes polling strategy instance from configuration properties.executor
(ScheduledExecutorService executor) Sets a customservice
used to schedule polling ticks on.get()
-
Method Details
-
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:
-
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
Builds a new polling strategy.- Specified by:
build
in interfaceBuilder<PollingStrategies.ScheduledBuilder,
PollingStrategy> - Returns:
- the new instance
-
get
- Specified by:
get
in interfaceBuilder<PollingStrategies.ScheduledBuilder,
PollingStrategy> - Specified by:
get
in interfaceSupplier<PollingStrategy>
-