Tutorial 1: The Basics

The goal of this tutorial is to teach the use of the Service Activator Toolkit through the development of some simple service-oriented bundles. The tutorial is simple and focuses on understanding how best to use SAT to build service-oriented bundles rather than teaching OSGi.

The Prerequisites

Before you start this tutorial you should have:

Vendor Tutorial

The Vendor Application

The diagram on the right shows the topology of the tutorial application.

The Steps

This tutorial consists of the following steps:

  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.
  2. Create the Hotdog Vendor Bundle: In this step the Hotdog Vendor bundle is created that imports the package containing the VendorService interface and registers an implementation of the service with the OSGi framework.
  3. Create the Popcorn Vendor Bundle: In this step the Popcorn Vendor bundle is created that also imports the package containing the VendorService interface and registers an implementation of the service with the OSGi framework.
  4. Create the Customer Bundle: In this step the Customer bundle is created that imports the package containing the VendorService interface and acquires an implementation of the interface from the OSGi framework.
  5. Launching the Vendor Application: In this step the Equinox OSGi Framework will be launched with our application bundles installed and started.
  6. Testing the Vendor Application: In this step the application will be tested using the OSGi console commands.

Source Projects

The source projects for this tutorial are available as a zip file that may be extracted into the file system and imported into your Eclipse workspace.