tags:

views:

38

answers:

2

Hi,

Im trying to create an application which can fire-up felix, and also publish services to the 'Declarative Services' bundle. But with my 'felix-starter' and services effectively being inside the same jar.

i assume the jar containing both the osgi-host(Felix) and misc. services should contain the xml file describing the provided/required services to 'DS'. But i don't know if it is possible (while the jar is already loaded by e.g. webstart, thus having a ClassLoader configured for it) to programatically feed that XML to the DS bundle.

Is that possible in some way, or would that end up being nasty?

Thanks

A: 

I guess i should better do it the obvious way. Have one jar which contains felix host, another jar being the app-bundle, then another few jars being the compendium bundles. That way it is also easily maintainable

Houtman
A: 

FWIW, you could place your bundle jar files (as jar files, not extracted) into the "master" jar file, and load them from there (a bundle can be loaded from any kind of InputStream).

This seems to be what people trying to integrate WebStart with OSGi are doing: see this related question on dynamically loading additional jar file using WebStart.

Thilo