Chapter 4. Studying services


This chapter covers
  • Understanding what services are and why they’re useful
  • Publishing and using services
  • Dealing with service dynamism
  • Modifying an application to use services
  • Relating services to the module and lifecycle layers


So far, you’ve seen two layers of the OSGi framework. The module layer helps you separate an application into well-defined, reusable bundles, and the lifecycle layer builds on the module layer to help you manage and evolve bundles over time. Now we’ll make things even more dynamic with the third and final layer of OSGi: services.

We’ll start this chapter with a general discussion about services to make sure we’re all thinking about the same thing. We’ll then look at when you should ...

Get OSGi in Action: Creating Modular Applications in Java now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.