java.lang.Object
io.helidon.config.ScheduledPollingStrategy
- All Implemented Interfaces:
PollingStrategy
A strategy which allows the user to schedule periodically fired polling event.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent API builder forScheduledPollingStrategy
.static interface
An SPI that allows users to define their own policy how to change the interval between scheduled ticking.static class
Regular polling strategy implementation.Nested classes/interfaces inherited from interface io.helidon.config.spi.PollingStrategy
PollingStrategy.Polled
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Fluent API builder forScheduledPollingStrategy
.static ScheduledPollingStrategy
create
(ScheduledPollingStrategy.RecurringPolicy recurringPolicy, ScheduledExecutorService executor) Creates a polling strategy with an interval of the polling as a parameter.void
start
(PollingStrategy.Polled polled) Start this polling strategy.void
stop()
Stop polling and release all resources.toString()
-
Method Details
-
create
public static ScheduledPollingStrategy create(ScheduledPollingStrategy.RecurringPolicy recurringPolicy, ScheduledExecutorService executor) Creates a polling strategy with an interval of the polling as a parameter.If parameter
executor
isnull
then a newScheduledExecutorService
is created.- Parameters:
recurringPolicy
- a recurring policyexecutor
- an executor- Returns:
- configured strategy
-
builder
Fluent API builder forScheduledPollingStrategy
.- Returns:
- a new builder instance
-
start
Description copied from interface:PollingStrategy
Start this polling strategy. From this point in time, the polled will receive events onPollingStrategy.Polled.poll(java.time.Instant)
. It is the responsibility of thePollingStrategy.Polled
to handle such requests. AConfigSource
needs only support for polling stamps to support a polling strategy, the actual reloading is handled by the configuration component. There is no need to implementPollingStrategy.Polled
yourself, unless you want to implement a new component that supports polling. Possible reloads of configuration are happening within the thread that invokes this method.- Specified by:
start
in interfacePollingStrategy
- Parameters:
polled
- a component receiving polling events.
-
stop
public void stop()Description copied from interface:PollingStrategy
Stop polling and release all resources.- Specified by:
stop
in interfacePollingStrategy
-
toString
-