- All Implemented Interfaces:
A strategy which allows the user to schedule periodically fired polling event.
Nested Class SummaryModifier and TypeClassDescription
static final classA fluent API builder for
static interfaceAn SPI that allows users to define their own policy how to change the interval between scheduled ticking.
static classRegular polling strategy implementation.
Method SummaryModifier and TypeMethodDescription
static ScheduledPollingStrategyCreates a polling strategy with an interval of the polling as a parameter.
voidStart this polling strategy.
stop()Stop polling and release all resources.
createpublic static ScheduledPollingStrategy create
(ScheduledPollingStrategy.RecurringPolicy recurringPolicy, ScheduledExecutorService executor)Creates a polling strategy with an interval of the polling as a parameter.
nullthen a new
recurringPolicy- a recurring policy
executor- an executor
- configured strategy
builderpublic static ScheduledPollingStrategy.Builder builder()
- a new builder instance
startpublic void start
(PollingStrategy.Polled polled)Description copied from interface:
PollingStrategyStart this polling strategy. From this point in time, the polled will receive events on
PollingStrategy.Polled.poll(java.time.Instant). It is the responsibility of the
PollingStrategy.Polledto handle such requests. A
ConfigSourceneeds only support for polling stamps to support a polling strategy, the actual reloading is handled by the configuration component. There is no need to implement
PollingStrategy.Polledyourself, unless you want to implement a new component that supports polling. Possible reloads of configuration are happening within the thread that invokes this method.
stoppublic void stop()Description copied from interface:
PollingStrategyStop polling and release all resources.
toStringpublic String toString()