public static final class PollingStrategies.ScheduledBuilder extends Object implements Builder<PollingStrategy>
| Modifier and Type | Method and 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 custom
service used to schedule polling ticks on. |
PollingStrategy |
get() |
public static PollingStrategies.ScheduledBuilder create(Config metaConfig) throws ConfigMappingException, MissingValueException
Mandatory properties, see PollingStrategies.regular(Duration):
interval - type Duration, e.g. PT15S means 15 secondsmetaConfig - meta-configuration used to initialize returned polling strategy builder instance from.metaConfigMissingValueException - 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.PollingStrategies.regular(Duration)public PollingStrategies.ScheduledBuilder executor(ScheduledExecutorService executor)
service used to schedule polling ticks on.
By default it is a new thread pool executor per polling strategy instance.
executor - the custom scheduled executor servicepublic PollingStrategy build()
build in interface Builder<PollingStrategy>public PollingStrategy get()
get in interface Builder<PollingStrategy>get in interface Supplier<PollingStrategy>Copyright © 2018–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.