This chapter addresses the notion that bundles and services can come and go throughout the lifetime of a running system. Dynamic behavior is one of the hallmarks of OSGi-based systems and is central to many of the design and implementation decisions you make. Here we present three mechanisms for dealing with the dynamic nature of services: OSGi’s Service Trackers, a third-party mechanism called the Service Activator Toolkit (SAT), and finally OSGi’s Declarative Services.
The goals of this chapter are to
• Modify the bundle activators in Toast to use OSGi Service Trackers so they can handle dynamic services
• Present the Service Activator Toolkit as a very simple way to write bundle activators that handle dynamic services ...