Jun 15th, 2011, 05:06 AM
Initialize application context manually
I'm using Spring in OSGi-based application. Spring Extender creates application contexts automatically when it locates spring-based bundle when it becomes ACTIVE.
But I have a task, when I need to configure bundle before extender will create application context for it. For example, I need to change database settings via ConfigAdmin sevice before starting context.
In general, I have scenario like this:
- install and start bundle
- bundle registers some configuration services.
- "client" sets configuration settings
- Configuration service starts application context for this bundle.
- When settings are updated, service restarts application context.
For now, I can't handle when to start context for bundle or not. Extender makes it for me. Is there any way to handle application context creation/descrution for bundle manually beside creating my own application context inside bundle and import/export services to bundleContext manually?
Tags for this Thread