Package org.openhab.core.service
Interface WatchServiceFactory
@NonNullByDefault
public interface WatchServiceFactory
The
WatchServiceFactory is used to create WatchService instances.
For files in the openHAB configuration folder a watch service with the name WatchService.CONFIG_WATCHER_NAME
is registered. For convenience, an OSGi target filter for referencing this watch service is provided
WatchService.CONFIG_WATCHER_FILTER.- Author:
- Jan N. Klug - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateWatchService(String name, Path basePath) Create a newWatchServiceservice component with the given name and path or return the already existing instance if aWatchServicewith the given name was created before.voidremoveWatchService(String name) Dispose theWatchServiceservice component
-
Method Details
-
createWatchService
Create a newWatchServiceservice component with the given name and path or return the already existing instance if aWatchServicewith the given name was created before.- Parameters:
name- the name of the service to create/get (must follow the conventions of an OSGi service name)basePath- the base path of the watch service (path is created if it does not exist)- Throws:
IOException- if theWatchServicecould not be instantiated
-
removeWatchService
Dispose theWatchServiceservice component- Parameters:
name- the name of theWatchService
-