Step 1: Create the Vendor Service Bundle

In this step the Vendor Service library bundle is created that exports a package that contains the VendorService interface. Other bundles will create implementations of this interface and register them with the OSGi framework, while others will acquire an implementation of this interface from the OSGi framework.

  1. Create a new plug-in project called org.eclipse.soda.sat.tutorial.vendor.service that is targeted for the standard OSGi framework.
  2. Set the Plug-in ID field to org.eclipse.soda.sat.tutorial.vendor.service, making it match the name of the plug-in project.
  3. Create Plug-in Project

  4. Set the Plug-in Name field to Vendor Service.
  5. Take care on the second page of the wizard to uncheck the checkbox titled Generate an activator, a Java class that controls the plug-in's life cycle since we do not want the PDE to generate a bundle activator.
  6. Create Plug-in Project

  7. Add a package called org.eclipse.soda.sat.tutorial.vendor.service.
  8. Add an interface to the package called VendorService as follows:
    package org.eclipse.soda.sat.tutorial.vendor.service;
    
    public interface VendorService {
      public static final String SERVICE_NAME = VendorService.class.getName();
      public String getName();
      public String sell();
    }
    
  9. Automated Management of Dependencies
  10. Open the plug-in's META-INF/MANIFEST.MF file using the manifest editor. Turn to the Runtime page and add the package org.eclipse.soda.sat.tutorial.vendor.service to the Exported Packages list.
  11. The plug-in's META-INF/MANIFEST.MF file should be as follows. Note that the Bundle-Localization manifest header has been removed since it is not necessary for this tutorial.
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: Vendor Service
    Bundle-SymbolicName: org.eclipse.soda.sat.tutorial.vendor.service
    Bundle-Version: 1.0.0
    Export-Package: org.eclipse.soda.sat.tutorial.vendor.service