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 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 and Description |
---|---|
static class |
ResourceWatcherService.Frequency |
lifecycle
deprecationLogger, 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, stop
logDeprecatedSetting, logRemovedSetting, nodeName
@Inject public ResourceWatcherService(Settings settings, ThreadPool threadPool)
protected void doStart()
doStart
in class AbstractLifecycleComponent<ResourceWatcherService>
protected void doStop()
doStop
in class AbstractLifecycleComponent<ResourceWatcherService>
protected void doClose()
doClose
in class AbstractLifecycleComponent<ResourceWatcherService>
public <W extends ResourceWatcher> WatcherHandle<W> add(W watcher) throws IOException
MEDIUM
frequencyIOException
public <W extends ResourceWatcher> WatcherHandle<W> add(W watcher, ResourceWatcherService.Frequency frequency) throws IOException
IOException
public void notifyNow()
public void notifyNow(ResourceWatcherService.Frequency frequency)
Copyright © 2009–2016. All rights reserved.