public class ResourceWatcherService extends AbstractLifecycleComponent<ResourceWatcherService>
add(ResourceWatcher)
method. This service will call ResourceWatcher.checkAndNotify() method of all
registered watcher periodically. The frequency of checks can be specified using watcher.interval setting, which
defaults to 60s. The service can be disabled by setting watcher.enabled setting to false.| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceWatcherService.Frequency |
lifecyclecomponentSettings, logger, settings| Constructor and Description |
|---|
ResourceWatcherService(Settings settings,
ThreadPool threadPool) |
| Modifier and Type | Method and 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) |
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stopnodeName@Inject public ResourceWatcherService(Settings settings, ThreadPool threadPool)
protected void doStart()
throws ElasticsearchException
doStart in class AbstractLifecycleComponent<ResourceWatcherService>ElasticsearchExceptionprotected void doStop()
throws ElasticsearchException
doStop in class AbstractLifecycleComponent<ResourceWatcherService>ElasticsearchExceptionprotected void doClose()
throws ElasticsearchException
doClose in class AbstractLifecycleComponent<ResourceWatcherService>ElasticsearchExceptionpublic <W extends ResourceWatcher> WatcherHandle<W> add(W watcher)
MEDIUM frequencypublic <W extends ResourceWatcher> WatcherHandle<W> add(W watcher, ResourceWatcherService.Frequency frequency)
public void notifyNow()
public void notifyNow(ResourceWatcherService.Frequency frequency)
Copyright © 2009–2016. All rights reserved.