Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning
titleWARNING

Felix 1.4.0 introduced some significant changes to its configuration properties; if you are upgrading from a previous version, the usage document describes the configuration property changes.

...

In reality, the first step is optional, since all properties will have reasonable defaults, but if you are creating a launcher you will generally want to more than that, such as automatically installing and starting bundles when you start the framework instance. The default Felix launcher defines reusable functionality to automatically install and/or start bundles upon framework startup; see the usage document for more information on configuring Felix and on the various configuration properties.

...

  1. The launcher only supports a single, optional command-line argument, which is the path to the bundle cache, so check for this and issue a usage message it there are more than one arguments.
  2. Load any system properties specified in the system.properties file; this file is typically located in the conf/ directory of the Felix installation directory, but it can be specified directly using the felix.system.properties system property. This file is not needed to launch Felix and is provided merely for convenience when system properties must be specified. The file is a standard Java properties file, but it also supports property substitution using ${<property-name} syntax. Property substitution can be nested; only system properties will be used for substitution.
  3. Load any configuration properties specified in the config.properties file; this file is typically located in the conf/ directory of the Felix installation directory, but it can be specified directly using the felix.config.properties system property. This file is used to configure the Felix instance created by the launcher. The file is a standard Java properties file, but it also supports property substitution using "${<property-name}" syntax. Property substitution can be nested; configuration and system properties will be used for substitution with configuration properties having precedence.
  4. For convenience, any configuration properties that are set as system properties are copied into the set of configuration properties. This provide an easy way to add to or override configuration properties specified in the config.properties file, since the Felix instance will never look at system properties for configuration.
  5. If there is a single command-line argument, then use that to set the value of org.osgi.framework.storage; relative paths are relative to the current directory unless the felix.cache.rootdir property is set.
  6. Create a list to hold custom framework activators and add an instance of org.apache.felix.main.AutoActivator, which will process felix.auto.install and felix.auto.start configuration properties during framework startup to automatically install and/or start bundles; see the usage document for more information configuration properties.
  7. Create the Felix instance passing in the configuration properties, then call start().
  8. Invoke waitForStop() to wait for the framework to stop to force the VM to exit; this is necessary because the framework never calls System.exit() and some libraries (e.g., Swing) create threads that will not allow the VM to exit.

...