- java.lang.Object
-
- io.helidon.config.etcd.EtcdWatcher
-
- All Implemented Interfaces:
ChangeWatcher<EtcdConfigSourceBuilder.EtcdEndpoint>
public class EtcdWatcher extends Object implements ChangeWatcher<EtcdConfigSourceBuilder.EtcdEndpoint>
Etcd watch strategy is based on etcd watch operation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.config.spi.ChangeWatcher
ChangeWatcher.ChangeEvent<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EtcdWatcher
create()
Creates a change watcher for sources based on etcd that provideEtcdConfigSourceBuilder.EtcdEndpoint
as a target.static EtcdWatcher
create(Config metaConfig)
Create a new instance from meta configuration.void
start(EtcdConfigSourceBuilder.EtcdEndpoint endpoint, Consumer<ChangeWatcher.ChangeEvent<EtcdConfigSourceBuilder.EtcdEndpoint>> listener)
Start watching a target for changes.void
stop()
Stop watching all targets for changes.Class<EtcdConfigSourceBuilder.EtcdEndpoint>
type()
Target supported by this change watcher.
-
-
-
Method Detail
-
create
public static EtcdWatcher create()
Creates a change watcher for sources based on etcd that provideEtcdConfigSourceBuilder.EtcdEndpoint
as a target.- Returns:
- configured polling strategy
-
create
public static EtcdWatcher create(Config metaConfig)
Create a new instance from meta configuration.- Parameters:
metaConfig
- currently ignored- Returns:
- a new etcd watcher
-
start
public void start(EtcdConfigSourceBuilder.EtcdEndpoint endpoint, Consumer<ChangeWatcher.ChangeEvent<EtcdConfigSourceBuilder.EtcdEndpoint>> listener)
Description copied from interface:ChangeWatcher
Start watching a target for changes. If a change happens, notify the listener.- Specified by:
start
in interfaceChangeWatcher<EtcdConfigSourceBuilder.EtcdEndpoint>
- Parameters:
endpoint
- target of this watcher, such asPath
listener
- listener that handles reloading of the resource being watched
-
stop
public void stop()
Description copied from interface:ChangeWatcher
Stop watching all targets for changes.- Specified by:
stop
in interfaceChangeWatcher<EtcdConfigSourceBuilder.EtcdEndpoint>
-
type
public Class<EtcdConfigSourceBuilder.EtcdEndpoint> type()
Description copied from interface:ChangeWatcher
Target supported by this change watcher.- Specified by:
type
in interfaceChangeWatcher<EtcdConfigSourceBuilder.EtcdEndpoint>
- Returns:
- type supported
-
-