java.io.Closeable, java.lang.AutoCloseable, LifecycleComponent, Releasablepublic class ResourceWatcherService extends AbstractLifecycleComponent
add(ResourceWatcher)
method. This service will call ResourceWatcher.checkAndNotify() method of all
registered watcher periodically. The frequency of checks can be specified using resource.reload.interval setting, which
defaults to 60s. The service can be disabled by setting resource.reload.enabled setting to false.| Modifier and Type | Class | Description |
|---|---|---|
static class |
ResourceWatcherService.Frequency |
| Modifier and Type | Field | Description |
|---|---|---|
static Setting<java.lang.Boolean> |
ENABLED |
|
static Setting<TimeValue> |
RELOAD_INTERVAL_HIGH |
|
static Setting<TimeValue> |
RELOAD_INTERVAL_LOW |
|
static Setting<TimeValue> |
RELOAD_INTERVAL_MEDIUM |
deprecationLogger, logger, settingslifecycle| Constructor | Description |
|---|---|
ResourceWatcherService(Settings settings,
ThreadPool threadPool) |
| Modifier and Type | Method | Description |
|---|---|---|
<W extends ResourceWatcher> |
add(W watcher) |
Register new resource watcher that will be checked in default
MEDIUM frequency |
<W extends ResourceWatcher> |
add(W watcher,
ResourceWatcherService.Frequency frequency) |
Register new resource watcher that will be checked in the given frequency
|
protected void |
doClose() |
|
protected void |
doStart() |
|
protected void |
doStop() |
|
void |
notifyNow() |
|
void |
notifyNow(ResourceWatcherService.Frequency frequency) |
logDeprecatedSetting, logRemovedSetting, nodeNameaddLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stoppublic static final Setting<java.lang.Boolean> ENABLED
@Inject public ResourceWatcherService(Settings settings, ThreadPool threadPool)
protected void doStart()
doStart in class AbstractLifecycleComponentprotected void doStop()
doStop in class AbstractLifecycleComponentprotected void doClose()
doClose in class AbstractLifecycleComponentpublic <W extends ResourceWatcher> WatcherHandle<W> add(W watcher) throws java.io.IOException
MEDIUM frequencyjava.io.IOExceptionpublic <W extends ResourceWatcher> WatcherHandle<W> add(W watcher, ResourceWatcherService.Frequency frequency) throws java.io.IOException
java.io.IOExceptionpublic void notifyNow()
public void notifyNow(ResourceWatcherService.Frequency frequency)