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 Details

    • createWatchService

      void createWatchService(String name, Path basePath) throws IOException
      Create a new WatchService service component with the given name and path or return the already existing instance if a WatchService 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 the WatchService could not be instantiated
    • removeWatchService

      void removeWatchService(String name)
      Dispose the WatchService service component
      Parameters:
      name - the name of the WatchService