Versions Compared

Key

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

...

The start() method is used to start the framework instance. If the init() method was not invoked prior to calling start(), then it is implicitly invoked from by start(). The two methods result in two different framework state transitions:

...

  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 will be are copied into the set of configuration properties to . 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.

...