public class DirectoryWatcherextends java.lang.Threadimplements org.osgi.framework.BundleListener
-DirectoryWatcher- This class runs a background task that checks a directory for new files or removed files. These files can be configuration files or jars. For jar files, its behavior is defined below: - If there are new jar files, it installs them and optionally starts them. - If it fails to install a jar, it does not try to install it again until the jar has been modified. - If it fail to start a bundle, it attempts to start it in following iterations until it succeeds or the corresponding jar is uninstalled. - If some jar files have been deleted, it uninstalls them. - If some jar files have been updated, it updates them. - If it fails to update a bundle, it tries to update it in following iterations until it is successful. - If any bundle gets updated or uninstalled, it refreshes the framework for the changes to take effect. - If it detects any new installations, uninstallations or updations, it tries to start all the managed bundle unless it has been configured to only install bundles.