Versions Compared

Key

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

...

Most of the above meta-data is for human consumption and does not affect the OSGi framework. Only the Bundle-Activator and Import-Package meta-data is used by the framework. The Bundle-Activator attribute tells the framework which class implements the BundleActivator interface. With this information, when the OSGi framework starts the bundle, an instance of the specified class is created and its start() method is invoked. The created instance will also have its stop() method called when the framework stops the bundle. The Import-Package attribute informs the framework of the bundle's dependencies on external packages; all bundles with an activator must import org.osgi.framework since it contains the core OSGi class definitions. Any packages dependencies will be verified and resolved by the OSGi framework. (Note: Make sure your manifest file ends in a trailing carriage return or else the last line will be ignored.)

Now we need to compile the source code. To compile we must have the felix.jar file (found in Felix' bin directory) in our class path. We compile the source file using a command like:

...