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 (and shouldn’t) use services and walk through an example to demonstrate the OSGi service model. At this point, you should understand the basics, so we’ll take a closer look at how best to handle the dynamics of OSGi services, including common pitfalls and how to avoid them.

With these techniques in mind, you’ll update the ongoing paint program to use services and see how the service layer relates to the module and lifecycle layers. We’ll conclude with a review of standard OSGi framework services and tell you more about the compendium. As you can see, we have many useful and interesting topics to cover, so let’s get started and talk about services.

4.1. The what, why, and when of services

 
 

4.2. OSGi services in action

 
 

4.3. Dealing with dynamics

 
 
 
 

4.4. Using services in the paint example

 
 
 
 

4.5. Relating services to modularity and lifecycle

 
 
 

4.6. Standard services

 
 

4.7. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest