Versions Compared

Key

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

...

The Greeter Service implementation bundle provides a trivial implementation of the GreeterService interface. Additionally, it has an Activator:

...

The Service Consumer Java code contains no specific Distribution-related elements. It's simply an Activator that creates a ServiceTracker listening for services that implement the GreeterService interface. When the service becomes available it opens a little GUI window that asks you for an argument that can be sent to the Greete Greeter service. See here for the actual code

Tip

Note that in many cases using an OSGi Component Framework such as Spring-DM, iPojo or OSGi DS is highly recommeded when writing OSGi Service Consumers. OSGi Services are highly dynamic in nature. They can come and go. Using a component framework will generally save you from writing ServiceTracker code as the framework will generally provide the service consumer with a reference to the service via injection.

...