Chapter 1. OSGi and the enterprise—why now?
Listing 1.1. A simple bundle manifest that imports and exports packages
Chapter 2. Developing a simple OSGi-based web application
Listing 2.1. The WEB-INF/web.xml file
Listing 2.2. The SayHello.java file
Listing 2.3. The MANIFEST.MF file
Listing 2.4. The doGet method with message translation
Listing 2.5. The SpecialOffer interface
Listing 2.6. The Food interface
Listing 2.7. The RomanticChocolateOffer class
Listing 2.8. A simple blueprint.xml file
Listing 2.9. The manifest of the fancyfoods.business bundle
Listing 2.10. Using Blueprint to inject dependencies
Listing 2.11. The OfferAggregator class
Listing 2.12. Adding special offers using JNDI to access OSGi Services
Chapter 3. Persistence pays off
Listing 3.1. An OSGI-INF/blueprint/blueprint.xml file that defines a Derby datasource
Listing 3.2. The META-INF/persistence.xml file
Listing 3.3. The implementation of the FoodImpl entity class
Listing 3.4. The interface for the food persistence service
Listing 3.5. The blueprint.xml for the persistence bundle
Listing 3.6. InventoryPopulator fills the database when the bundle starts
Listing 3.7. The Blueprint for registering a special offer with an Inventory dependency
Listing 3.8. The DesperateCheeseOffer class
Listing 3.9. The chargeToAccount() method of the AccountingImpl class
Chapter 4. Packaging your enterprise OSGi applications
Chapter 6. Building dynamic applications with OSGi services
Listing 6.1. Registering an OSGi service using the OSGi API
Listing 6.2. Consuming a single OSGi service using the OSGi API
Listing 6.3. Consuming multiple OSGi services using the OSGi API
Listing 6.4. Declaring special offer service that has an Inventory dependency
Chapter 7. Provisioning and resolution
Listing 7.1. An excerpt of a repository XML serialization
Listing 7.2. The bundles in your repository
Listing 7.3. Successfully resolving with a uses clause
Listing 7.4. Successfully resolving with a uses clause
Listing 7.5. Failure to resolve with a uses clause
Listing 7.6. A Blueprint service definition
Listing 7.7. A Blueprint reference definition
Listing 7.8. A Blueprint reference-list definition
Listing 7.9. An OBR repository.xml generated by the Maven bundle plug-in
Chapter 8. Tools for building and testing
Listing 8.1. The bnd.bnd file for building the fancyfoods.persistence JAR
Listing 8.2. The pom.xml build file for the fancyfoods.api bundle
Listing 8.3. A sample pom.xml for the fancyfoods.department.cheese bundle
Listing 8.4. The pom.xml file for a Tycho build of the fancyfoods.business bundle
Listing 8.5. The pom.xml file to build the Fancy Foods EBA
Listing 8.6. Using mocked injection to unit test the desperate cheese offer
Listing 8.7. A class that provides options that can be shared between tests
Chapter 10. Hooking up remote systems with distributed OSGi
Listing 10.1. A foreign foods special offer service
Listing 10.2. Populating the foreign food database
Listing 10.3. Exposing your remote service
Listing 10.4. A remote services endpoint configuration bundle manifest
Listing 10.5. A remote services endpoint configuration file
Listing 10.6. Exposing your remote service
Listing 10.7. The remote services endpoint configuration file for SCA
Listing 10.8. The SCA configuration for a WSDL binding of a remote service
Chapter 11. Migration and integration
Listing 11.1. A minimal WAB manifest
Listing 11.2. Specifying a custom location for the persistence descriptor
Listing 11.3. A simple Spring application definition
Listing 11.4. A simple Blueprint application definition
Chapter 12. Coping with the non-OSGi world
Listing 12.1. A bnd-generated default manifest
Listing 12.2. A bnd manifest generated with configuration
Listing 12.3. A well-generated bnd manifest
Listing 12.4. A completely configured bnd manifest
Listing 12.5. A default manifest from Bundlor
Listing 12.6. A template manifest for use with Bundlor
Listing 12.7. A configured, generated manifest from Bundlor
Listing 12.8. An ObjectInputStream that can handle restricted class visibility