Chapter 9. Advanced concepts
This chapter covers
- Globally configuring Spring DM’s extenders to integrate the framework into managed environments
- Using Spring DM in a secured OSGi container
- Advanced OSGi patterns that involve Spring DM
We’ve looked at how OSGi bundles can leverage the power of Spring by using Spring DM. Indeed, increasing the power of bundles through Spring’s features is a way to construct better, more modular OSGi applications. But OSGi applications always end up being deployed in OSGi containers, which we want to be robust, reliable, and stable. When we use Spring DM, its bundles are part of the infrastructure of the OSGi containers, so they must provide global configuration hooks (as apposed to per-bundle configuration) and they must be able to take advantage of some of the components that the environment provides.
In this chapter, we’ll cover how we can globally configure Spring DM’s extenders through fragment-based configuration. For the standard extender, settings range from thread management to the systematic registration of beans in Spring application contexts that Spring DM manages. The web extender also has its own settings that we can leverage; for example, to switch from one embedded web container to another. We’ll also introduce the OSGi security model and see how Spring DM can be integrated into a secured OSGi container.