Lets suppose we were in an alternate reality in which every artifact in maven repos was a correctly configured osgi bundle, using imports and exports rather than require-bundle.

Now suppose I've downloaded all the bundles locally and have fired up osgi so it can see all of them.

Now I try to load a bundle that imports some classes that are available from several bundles, say the geronimo, sun, and tomcat servlet 2.5 spec jars, or perhaps the slf4j interface classes.

What facilities does osgi or felix provide to help decide which bundle will be selected to provide these classes?


-background--

We're looking at using osgi in Geronimo. Currently we have a classloading system with most of the capabilities of the osgi classloading model but oriented more towards maven metadata. Each geronimo specific artifact has some dependency metadata like maven dependencies that specify most of the classloader, and you can tweak it with filters to emulate the import/export conditions in osgi.

Since the (multiple parents) of an artifact are specified as other artifacts, its easy, starting with a particular artifact, to pull in all its dependencies by artifact name and obtain all the pieces that are needed to run the artifact you are interested in. This is just like maven: you specify a dependency in your pom and it and all its transitive dependencies are automatically downloaded and made available to your build.

Btoh Geronimo and Maven have ways to override the original dependencies of an artifact and substitute something else.

IIUC in osgi one can use require-bundle to specify dependencies in a similar way but again IIUC this is highly frowned upon from a theoretical perspective and I don't know of any way of overriding require-bundle specifications.

So.... is there anything in osgi or felix that provides this kind of dependency specification that can be used with import/exports to specify specific bundles to satisfy import requirements?

many thanks
david jencks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to