5.2. Bundle State and Service Registration

In the last chapter, we explained that a bundle usually registers a service when it is started, and it unregisters the service when it is stopped. It is important to realize whether the service registered coincides with the bundle being activated, but this coincidence is not required.

On the one hand, it is perfectly legal for a bundle to be active without having registered its services, or to register them some time after it is first started. It is also permissible that an active bundle unregisters services at any time, even if it is not going to be stopped in the foreseeable future.

On the other hand, when a client bundle has been successfully resolved (that is, its Import-Package declaration has been ...

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.