...
We must create a manifest.mf file that contains the metadata for our bundle; the manifest file contains the following:
No Format |
---|
Bundle-Activator: tutorial.example2b.Activator Import-Package: tutorial.example2.service Bundle-Name: French dictionary Bundle-Description: A bundle that registers a French dictionary service Bundle-Vendor: Apache Felix Bundle-Version: 1.0.0 Bundle-Activator: tutorial.example2b.Activator Import-Package: org.osgi.framework, tutorial.example2.service |
We specify which class implements the Bundle-Activator
interface and also specify that our bundle imports a shared the OSGi core package and the dictionary service interface package using the Import-Package
attribute. This import attribute Th dictionary service package will be fulfilled by the bundle in Example 2, which exports the package that this bundle is importing. The OSGi framework will automatically handle the details of resolving import packagesthis package.
To compile our source code, we need the felix.jar
file (found in Felix' bin
directory) in our class path. We compile the source file using a command like:
...