- java.lang.Object
-
- io.helidon.config.ScheduledPollingStrategy
-
- All Implemented Interfaces:
PollingStrategy
public final class ScheduledPollingStrategy extends Object implements PollingStrategy
A strategy which allows the user to schedule periodically fired polling event.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScheduledPollingStrategy.BuilderA fluent API builder forScheduledPollingStrategy.static interfaceScheduledPollingStrategy.RecurringPolicyAn SPI that allows users to define their own policy how to change the interval between scheduled ticking.static classScheduledPollingStrategy.RegularRecurringPolicyRegular polling strategy implementation.-
Nested classes/interfaces inherited from interface io.helidon.config.spi.PollingStrategy
PollingStrategy.Polled
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScheduledPollingStrategy.Builderbuilder()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.StringtoString()
-
-
-
Method Detail
-
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
public static ScheduledPollingStrategy.Builder builder()
Fluent API builder forScheduledPollingStrategy.- Returns:
- a new builder instance
-
start
public void start(PollingStrategy.Polled polled)
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
-
-