java.util.function.Supplier<PollingStrategy>public static final class PollingStrategies.ScheduledBuilder extends java.lang.Object implements java.util.function.Supplier<PollingStrategy>
| Modifier and Type | Method | Description |
|---|---|---|
PollingStrategy |
build() |
Builds a new polling strategy.
|
PollingStrategies.ScheduledBuilder |
executor(java.util.concurrent.ScheduledExecutorService executor) |
Sets a custom
service used to schedule polling ticks on. |
static PollingStrategies.ScheduledBuilder |
from(Config metaConfig) |
Initializes polling strategy instance from configuration properties.
|
PollingStrategy |
get() |
public static PollingStrategies.ScheduledBuilder from(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(java.util.concurrent.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()
public PollingStrategy get()
get in interface java.util.function.Supplier<PollingStrategy>Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.