Chapter 1. OSGi revealed
Listing 1.1. Example of the limitations of Java’s object-orientated encapsulation
Listing 1.2. Basic greeting implementation
Listing 1.3. Extended greeting implementation
Listing 1.4. OSGi bundle activator for our greeting implementation
Listing 1.5. Implementation of the Greeting interface
Listing 1.6. OSGi bundle activator with service registration
Listing 1.7. OSGi bundle activator with service discovery
Chapter 2. Mastering modularity
Listing 2.1. Contents of existing paint program’s JAR file
Listing 2.2. Existing PaintFrame.main() method implementation
Listing 2.3. New launcher for smaller paint program configuration
Chapter 3. Learning lifecycle
Listing 3.1. Simple shell bundle activator
Listing 3.2. BundleContext methods related to lifecycle management
Listing 3.3. Bundle interface methods related to lifecycle management
Listing 3.4. Bundle configuration by example
Listing 3.5. Bundle install command
Listing 3.6. Bundle start command
Listing 3.7. Bundle stop command
Listing 3.8. Bundle update command
Listing 3.9. Bundle uninstall command
Listing 3.10. Bundle information example
Listing 3.11. Bundle persistent storage example
Listing 3.12. Bundle and framework event listener example
Listing 3.13. Example of how a bundle can stop itself
Listing 3.14. BundleTracker class declaration and constructor
Listing 3.15. Opening and using a BundleTracker
Listing 3.16. Disposing of a BundleTracker
Listing 3.17. Processing shapes in ShapeTracker