@Singleton public class DirectoryWatcherService extends Object
This creates a DirectoryWatcher
, i.e. our low-level implementation of Java's WatchService
API.
This watcher is then only started (submitted for execution) upon first request to register a directory.
Constructor and Description |
---|
DirectoryWatcherService(MagnoliaConfigurationProperties properties) |
Modifier and Type | Method and Description |
---|---|
void |
register(Path path,
Predicate<Path> filterPredicate,
WatcherCallback callback)
Registers a directory to the
DirectoryWatcher , with given filtering predicate and callback. |
void |
register(Path path,
com.google.common.base.Predicate<Path> filterPredicate,
WatcherCallback callback)
Deprecated.
since 6.1 use
register(Path, Predicate, WatcherCallback) with plain Java predicate |
void |
start() |
void |
stop() |
@Inject public DirectoryWatcherService(MagnoliaConfigurationProperties properties) throws IOException
IOException
public void start()
public void register(Path path, Predicate<Path> filterPredicate, WatcherCallback callback) throws IOException
DirectoryWatcher
, with given filtering predicate and callback.IOException
@Deprecated public void register(Path path, com.google.common.base.Predicate<Path> filterPredicate, WatcherCallback callback) throws IOException
register(Path, Predicate, WatcherCallback)
with plain Java predicateDirectoryWatcher
, with given filtering predicate and callback.IOException
public void stop()
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.