Directory deployer

Simple bundle which scans file system directories and installs/uninstalls bundles found or removed from these directories.

This is a quite useful tool for handle bundle deployment without using any console. Just copy the bundles that should be started to the deploy directory, and the directory deployer will find and start them. When the files are removed, they are uninstalled.

Deploy method

The procedure for scanning and deploying is as follows:

  1. Check if any new files have appeared or if any already deployed files has been replaced with newer files.
  2. New files are installed into the framework.
    If they are not fragment bundles, they are marked for start at the end of the scan.
    Files newer than a previously deployed bundle are updated.
  3. Files that have the same location as an already installed bundle is not installed again, instead, the installed bundle is re-used in the created DeployedFile instance.
  4. Check if there are bundle installed by the directory deployer that does not correspond to a file found during the directory scan. If such bundles are found uninstall them.
  5. If any bundle update was performed during the scan, perform a refresh packages operation for them using the in the package admin service.
  6. Files marked for start are started.
  7. Sleep a while
  8. Repeat from 1.

Configuration

See metatype.xml for specification using CM. The same properties as defined by CM are also read as default values from framework properties. Thus, the bundle can be both configured by CM and using system properties.

Quick guide to the metatype.xml format:

For details on the metatype format, see http://www.knopflerfish.org/XMLMetatype/

You can set the deployment directory in metatype.xml in the bundle's resource directory (defaults to ./load). A relative deployment directory path is relative to the directory from which the framework is started.

The table below describes the framework properties that may be used to set the default values for the directory deployer configuration.
Name Description Type Default
org.knopflerfish.fileinstall.dir Set the directories that should be scanned.

The value should be a comma-separated list of directory paths.

String ./load
org.knopflerfish.fileinstall.poll Poll interval in milliseconds between directory scans. Must be at least 100 ms. long 1000
org.knopflerfish.fileinstall.startlevel Bundle start level to assign to all newly installed bundles. int The initial bundle startlevel as returned by the StartLeve-service.
org.knopflerfish.fileinstall.uninstallOnStop If true then the directory deployer will uninstall all bundles that it has installed when it stopps. boolean true