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
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent API builder forScheduledPollingStrategy.static interfaceAn SPI that allows users to define their own policy how to change the interval between scheduled ticking.static classRegular 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 ScheduledPollingStrategycreate(ScheduledPollingStrategy.RecurringPolicy recurringPolicy, ScheduledExecutorService executor) Creates a polling strategy with an interval of the polling as a parameter.voidstart(PollingStrategy.Polled polled) Start this polling strategy.voidstop()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
executorisnullthen a newScheduledExecutorServiceis 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:PollingStrategyStart 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.Polledto handle such requests. AConfigSourceneeds 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.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.- Specified by:
startin interfacePollingStrategy- Parameters:
polled- a component receiving polling events.
-
stop
public void stop()Description copied from interface:PollingStrategyStop polling and release all resources.- Specified by:
stopin interfacePollingStrategy
-
toString
-