code: void stop() {
          try {
              dm.stop(getBundleContext());
          } catch (DirectoryMonitoringException e) {
              LOG.error("Failed to stop " + DirectoryMonitor.class.getName() + " for the directory " + monitoredDirectory, e);
          }
          declarationsFiles.clear();
          declarationRegistrationManager.unregisterAll();
      }
docs: This method must be called on the stop of the component. Stop the directory monitor and unregister all the
  declarations.