5.4. Dealing with Service Unregistration

If your service depends on the presence of another service, and there is a realistic chance that the other service may be unregistered at some point in time—perhaps because the service-providing bundle undergoes an update—you should program your service to protect yourself[1] from that event.

[1] That is, put yourself in the shoes of the client bundle in this chapter.

Such safeguard measures add quite a bit of complexity to your service, but the complexity is inherent in the component-based model. In the world of the OSGi framework, the earth does stand on top of giant tortoises, and you do not want to be thrown flat on your face when the ground moves away from under your feet!

The following sections list ...

Get Programming Open Service Gateways with Java Embedded Server™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.