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 TypeMethodDescriptionvoid
createWatchService
(String name, Path basePath) Create a newWatchService
service component with the given name and path or return the already existing instance if aWatchService
with the given name was created before.void
removeWatchService
(String name) Dispose theWatchService
service component
-
Method Details
-
createWatchService
Create a newWatchService
service component with the given name and path or return the already existing instance if aWatchService
with 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 theWatchService
could not be instantiated
-
removeWatchService
Dispose theWatchService
service component- Parameters:
name
- the name of theWatchService
-