- 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 class
ScheduledPollingStrategy.Builder
A fluent API builder forScheduledPollingStrategy
.static interface
ScheduledPollingStrategy.RecurringPolicy
An SPI that allows users to define their own policy how to change the interval between scheduled ticking.static class
ScheduledPollingStrategy.RegularRecurringPolicy
Regular 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.Builder
builder()
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.String
toString()
-
-
-
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
executor
isnull
then a newScheduledExecutorService
is 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: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
-
-