Chapter 5. Pointers and Pitfalls

In the previous chapters, you have seen the most important OSGi features that you will need to build real applications. There are still a lot of OSGi topics that we haven’t covered. The OSGi specification has been around for over 10 years, and some things have made in into the standards that turned out differently than expected and are better left untouched. This can be confusing to new users. Some features may even seem compelling at first. Therefore this chapter will discuss some of the features of OSGi that you should probably avoid.

Better Understanding OSGi Specifications

For someone new to OSGi, the phenomenon of OSGi specifications might be confusing. There are three different specification bodies relevant to users:

  • OSGi Core Specification
  • Compendium Services
  • Enterprise OSGi

The OSGi Core Specification describes the OSGi framework itself and is implemented by implementations such as Apache Felix and Eclipse Equinox. For the most part, you will not need to know all the details of the specification to work with OSGi, but it does describe all the rules of lifecycles, wiring, services, and complex topics such as the resolver and subsystems in newer versions of the specification. At the time of writing this book, the R5 specification is the latest version. The OSGi Core Specification moves rather slowly, and new features are only added if absolutely necessary. This is a good thing, because all other specifications are based on the Core Specification. ...

Get Building Modular Cloud Apps with OSGi now with O’Reilly online learning.

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