Chapter 9. Managing bundles
This chapter covers
- Versioning packages and bundles in a meaningful way
- Configuring bundles using the Configuration Admin Service
- Describing bundle configuration data using the Metatype Service
- Saving bundle settings using the Preferences Service
- Deferring bundle startup using lazy activation
We’ve covered a lot of ground so far. You know how to use modularity to improve the cohesiveness of your application code; how to use lifecycles to bring dynamic installations and updates to application environments; and how to use services to decouple your modules via interface-based programming techniques. You’ve also learned approaches and techniques for creating, testing, and debugging bundles. In this chapter and the next, we’ll move our focus away from coding bundles to issues of managing bundles and OSGi-based applications.
With the OSGi Service Platform, your deployed set of bundles becomes your application’s configuration. As such, the task of managing bundles is one of the most important skills you’ll need to fully master OSGi. In this chapter, we’ll explore different aspects of bundle management, including the following:
- Evolving a bundle using versioning policies
- Managing a bundle’s configuration data
- Configuring a bundle’s activation policy
With these skills, you’ll be better equipped to deploy and manage bundles in various application configurations. Let’s start by looking at versioning.