org.apache.felix.fileinstall.internal
Class DirectoryWatcher
java.lang.Object
java.lang.Thread
org.apache.felix.fileinstall.internal.DirectoryWatcher
- All Implemented Interfaces:
- Runnable, EventListener, BundleListener
public class DirectoryWatcher
- extends Thread
- implements 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.
- Author:
- Felix Project Team
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, toString, yield |
FILENAME
public static final String FILENAME
- See Also:
- Constant Field Values
POLL
public static final String POLL
- See Also:
- Constant Field Values
DIR
public static final String DIR
- See Also:
- Constant Field Values
LOG_LEVEL
public static final String LOG_LEVEL
- See Also:
- Constant Field Values
TMPDIR
public static final String TMPDIR
- See Also:
- Constant Field Values
FILTER
public static final String FILTER
- See Also:
- Constant Field Values
START_NEW_BUNDLES
public static final String START_NEW_BUNDLES
- See Also:
- Constant Field Values
USE_START_TRANSIENT
public static final String USE_START_TRANSIENT
- See Also:
- Constant Field Values
USE_START_ACTIVATION_POLICY
public static final String USE_START_ACTIVATION_POLICY
- See Also:
- Constant Field Values
NO_INITIAL_DELAY
public static final String NO_INITIAL_DELAY
- See Also:
- Constant Field Values
DISABLE_CONFIG_SAVE
public static final String DISABLE_CONFIG_SAVE
- See Also:
- Constant Field Values
START_LEVEL
public static final String START_LEVEL
- See Also:
- Constant Field Values
DirectoryWatcher
public DirectoryWatcher(Dictionary properties,
BundleContext context)
getThreadName
public static String getThreadName(Dictionary properties)
getProperties
public Dictionary getProperties()
start
public void start()
- Overrides:
start
in class 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 Runnable
- Overrides:
run
in class Thread
bundleChanged
public void bundleChanged(BundleEvent bundleEvent)
- Description copied from interface:
BundleListener
- Receives notification that a bundle has had a lifecycle change.
- Specified by:
bundleChanged
in interface BundleListener
- Parameters:
bundleEvent
- The BundleEvent
.
close
public void close()
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.