Looking up the inventory service from the bookshelf service code gives it access to objects hosted in another bundle (namely, in the bookshelf-inventory-impl-mock
bundle).
This is not of any great impact in this example, however, it is a good idea to keep in mind that those classes live in different bundles. The wiring made it so that the inventory implementation classes are visible from the bookshelf service context.
When working on more complex bundles that would need to make use of class or resource loaders, the bundle codebases and their class loaders are managed by the Felix framework. It's not always correct to assume that another object's class loader is the same as ours or that we're in the same class space. Remember to use the methods made available by the target bundle BundleContext
for loading resources from that bundle.
a. RESOLVED, INSTALLED, and then STARTED.
b. DOWNLOADED, INSTALLED, and then STARTED.
c. INSTALLED, RESOLVED, STARTING, and then ACTIVE.
a. When the bundle is starting.
b. When the bundle is stopping.
c. a and b.