Class DirectoryWatcher

  • java.lang.Object
    • java.lang.Thread
      • org.apache.felix.fileinstall.internal.DirectoryWatcher
  • All Implemented Interfaces:
    java.lang.Runnable, java.util.EventListener, org.osgi.framework.BundleListener

    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.
    Felix Project Team
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Constructor Summary

      Constructor and Description
      DirectoryWatcher(FileInstall fileInstall, java.util.Map<java.lang.String,java.lang.String> properties, org.osgi.framework.BundleContext context) 
    • Method Summary

      Modifier and TypeMethod and Description
      voidaddListener(ArtifactListener listener, long stamp) 
      voidbundleChanged(org.osgi.framework.BundleEvent bundleEvent) 
      protected voidfindBundlesWithFragmentsToRefresh(java.util.Set<org.osgi.framework.Bundle> toRefresh) 
      protected voidfindBundlesWithOptionalPackagesToRefresh(java.util.Set<org.osgi.framework.Bundle> toRefresh) 
      protected java.util.List<org.apache.felix.utils.manifest.Clause>getOptionalImports(java.lang.String importsStr) 
      protected java.util.Set<org.osgi.framework.Bundle>getScopedBundles(java.lang.String scope) 
      static java.lang.StringgetThreadName(java.util.Map<java.lang.String,java.lang.String> properties) 
      voidremoveListener(ArtifactListener listener) 
      Main run loop, will traverse the directory, and then handle the delta between installed and newly found/lost bundles and configurations.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DirectoryWatcher

        public DirectoryWatcher(FileInstall fileInstall,                java.util.Map<java.lang.String,java.lang.String> properties,                org.osgi.framework.BundleContext context)
    • Method Detail

      • getThreadName

        public static java.lang.String getThreadName(java.util.Map<java.lang.String,java.lang.String> properties)
      • getProperties

        public java.util.Map<java.lang.String,java.lang.String> getProperties()
      • start

        public void start()
        start in class java.lang.Thread
      • run

        public void run()
        Main run loop, will traverse the directory, and then handle the delta between installed and newly found/lost bundles and configurations.
        Specified by:
        run in interface java.lang.Runnable
        run in class java.lang.Thread
      • bundleChanged

        public void bundleChanged(org.osgi.framework.BundleEvent bundleEvent)
        Specified by:
        bundleChanged in interface org.osgi.framework.BundleListener
      • close

        public void close()
      • getScopedBundles

        protected java.util.Set<org.osgi.framework.Bundle> getScopedBundles(java.lang.String scope)
      • findBundlesWithFragmentsToRefresh

        protected void findBundlesWithFragmentsToRefresh(java.util.Set<org.osgi.framework.Bundle> toRefresh)
      • findBundlesWithOptionalPackagesToRefresh

        protected void findBundlesWithOptionalPackagesToRefresh(java.util.Set<org.osgi.framework.Bundle> toRefresh)
      • getOptionalImports

        protected java.util.List<org.apache.felix.utils.manifest.Clause> getOptionalImports(java.lang.String importsStr)

Copyright © 2006-2015 The Apache Software Foundation. All Rights Reserved.

Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14