Osgi Extender that bootstraps 'Spring powered bundles'.
The class listens to bundle events and manages the creation and destruction of application contexts for bundles that have one or both of:
- A manifest header entry Spring-Context
- XML files in META-INF/spring folder
The extender also discovers any Spring namespace/schema handlers in resolved bundles and makes them available through a dedicated OSGi service.
The extender behaviour can be customized by attaching fragments to the extender bundle. On startup, the extender will look for
META-INF/spring/*.xml
files and merge them into an application context. From the resulting context, the context will look for beans with predefined names to determine its configuration. The current version recognises the following bean names:
Bean Name | Bean Type | Description |
taskExecutor | org.springframework.core.task.TaskExecutor | Task executor used for creating the discovered application contexts. |
shutdownTaskExecutor | org.springframework.core.task.TaskExecutor | Task executor used for shutting down various application contexts. |
extenderProperties | java.util.Properties | Various properties for configuring the extender behaviour (see below) |
extenderProperties
recognises the following properties:
Name | Type | Description |
shutdown.wait.time | Number | The amount of time the extender will wait for each application context to shutdown gracefully. Expressed in milliseconds. |
process.annotations | Boolean | Whether or not, the extender will process SpringOSGi annotations. |
Note: The extender configuration context is created during the bundle activation (a synchronous OSGi lifecycle callback) and should contain only simple bean definitions that will not delay context initialisation.
@author Bill Gallagher
@author Andy Piper
@author Hal Hildebrand
@author Adrian Colyer
@author Costin Leau