- Type Parameters:
T
- target of this change watcher, such asPath
- All Known Implementing Classes:
EtcdWatcher
,FileSystemWatcher
public interface ChangeWatcher<T>
Similar to a
PollingStrategy
a change watcher is used to
identify a change and trigger reload of a ConfigSource
.
Where a polling strategy provides polling events to check for changes, change watcher
is capable of identifying a change in the underlying target using other means.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A change event, carrying the target, type of change and time of change. -
Method Summary
-
Method Details
-
start
Start watching a target for changes. If a change happens, notify the listener.- Parameters:
target
- target of this watcher, such asPath
listener
- listener that handles reloading of the resource being watched
-
stop
default void stop()Stop watching all targets for changes. -
type
Target supported by this change watcher.- Returns:
- type supported
-