concept application contexts in category spring

appears as: pplication contexts, application contexts
Spring Dynamic Modules in Action

This is an excerpt from Manning's book Spring Dynamic Modules in Action.

Let’s now focus on how Spring DM makes it easy to work with Spring within OSGi. In a classical Spring application, a dedicated Spring container is used, and the framework is configured from its enclosing contexts (from the classpath or web environment). The framework also provides a hierarchical relationship between application contexts while tying them together. With Spring DM, things work slightly differently. A dedicated Spring container is associated with each Spring DM–powered bundle. Each container is unconnected with the rest and is internal to its enclosing bundle. Logically speaking, having separate containers is mandatory because each bundle has its own lifecycle and can appear or disappear at any time.

  • Creation and destruction of application contexts (asynchronous or synchronous, management of the threads, and so on), covered in sections 9.2.2 and 9.2.3 respectively
  • 9.2.3. Task executor for destroying application contexts

    We explained in chapter 4 that the destruction of a bundle’s application context is done synchronously, before the bundle is stopped; otherwise the application context could not shut down properly. We also explained that before stopping, Spring DM’s extender computes a dependency graph to shut down in the right order all the application contexts it manages. Just like during creation, Spring DM’s extender performs a preparation step before closing application contexts, but it ends up submitting the task to a TaskExecutor.