A bundle which scans file system directories for files that it can install, update or uninstall. The directory deployer bundle handles both bundle files and configuration files. When a file is updated the bundle / configuration will be updated and when a file is removed from the scanned directory the bundle / configuration will be removed.
This is a quite useful tool for handle bundle and configuration deployment without using any console. Just copy the file that should be installed to the deploy directory, and the directory deployer will find and activate them. When the files are removed, they are uninstalled.
The procedure for scanning and deploying is as follows:
A sample XML-file with a configuration for the Directory Deployer bundle itself can be downloaded here.
To create a CM configuration from scratch one may use the CM-tab in Knopflerfish desktop, it presents a simple GUI based on configuration meta type descriptions provided by configurable bundles. The CM-tab is not visible in the Desktop when starting with the default set of bundles, to activate it one must install and start three more bundles from the Knopflerfish distribution: metatype (OSGi Metatyp APIs), kf_metatype_all (Knopflerfish Metatyp Service implementation) and cm_desktop (the CM-tab desktop plug in itself).
To save an existing CM configuration as cm_data XML one may use the CM-tab in the Knopflerfish desktop, it provides an Export... button that will export the current configuration as a cm_data XML file. It is also possible to use the Knopflerfish console command configuration export. See CM Commands for details. Avoid writing cm_data XML files by hand since the parser for the cm_data XML documents is written for machine generated documents so it does not give usable error messages when something in the XML-document is wrong.
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.
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.use.initial.startlevel |
When this property is true the Directory Deployer will not set any start level for bundles it installs thus those bundles will belong to the default start level (i.e., the current initial start level according to the Framework Start Level API). When this property is false the Directory Deployer will assign the start level given by org.knopflerfish.fileinstall.startlevel to the bundles it installs. |
boolean | true |
org.knopflerfish.fileinstall.startlevel | Bundle start level to assign to all newly installed bundles. Note that you must set org.knopflerfish.fileinstall.startlevel to false for this property to have an effect. | int | The initial bundle start level as returned by the StartLevel-API. |
org.knopflerfish.fileinstall.uninstallOnStop |
If true then the directory deployer will
uninstall all bundles and configurations that it has installed
when it stops.
|
boolean | true |
Package | Version | Providers |
---|---|---|
org.knopflerfish.service.dirdeployer | 0.0.0 | dirdeployer_all-4.0.1, dirdeployer_api-4.0.1 |
org.knopflerfish.shared.cm | 1.1.0 | dirdeployer_all-4.0.1 |