Reputation: 166
I'm starting an OSGI Spring DM based Swing application. The app should start and show up when the bundle is loaded. I know that this can be achieved with an activator class configured by manifest.mf file.
My problem: How can I inject bean references/services to this activator class using Spring as the activator is not configured in Spring context?
Should I not use the OSGI activator? How can Spring startup the application on bundle start?
Any kind of remarks are apreciated as I'm new to OSGI with Spring DM.
Cheers, Sven
Upvotes: 2
Views: 339
Reputation: 23958
You do not need an activator. Spring-DM has an "extender" bundle that automatically scans your bundle for two things:
META-INF/spring
folder of your bundle;Spring-Context
header in your MANIFEST.MF, which points to one or more .xml files that may be anywhere inside your bundle.If it finds either of these (and if your bundle is in the ACTIVE state) then it will load the Spring application context using the declared XML files.
Upvotes: 1