I am getting ready to do something similar for a web admin interface but haven't gotten far enough to try this... My thoughts were to just create a repository admin object from the bundle context, get the resolver (example in the bundlerepository Activator), then follow along the same lines as the _deploy method in ObrCommandImpl. I didn't see any connection to the shell...
Did I misunderstand your question? Chris On 11/29/06, Steven E. Harris <[EMAIL PROTECTED]> wrote:
First off, I need to thank the Felix developers for a great product. I've been able to integrate the Felix OSGi framework into my project with just a few days of study and experimentation. A difficult requirement in my project involves discovery and resolution of plugin dependencies. The client application needs to be able to download a plugin (an OSGi bundle), and then figure out which other plugins it must download and install before using the first plugin. Unlike Eclipse, we'd like to rely on the Import-Package and Export-Package header rather than the more explicit but less flexible Require-Bundle. The bundlerepository bundle contains all the code to do this dependency discovery, but it's wrapped up and tangled in with the Felix shell. I spent a long time studying org.apache.felix.bundlerepository.ObrCommandImpl before I realized that much of the _deploy() method is using interfaces from the org.osgi.service.obr package. That suggests that there's supposed to be some available programmatic means to do what the OBR-related commands offer in the shell. Next I found the class org.apache.felix.mosgi.managedelements.obrprobe.ObrProbe which implements the ObrProbeMBean interface's deploy() method. This implementation looks slimmed down from ObrCommandImpl's _deploy() method; I haven't yet figured out the difference between the two, beyond using LDAP-style filters in the former. Beyond using liberal cut-and-paste, is there some prescribed way for an application embedding Felix to incorporate this kind of deploy()/_deploy() capability? Searching the Web repeatedly for discussion on this topic has only led me back to reading the source code. Follow-up question: Couldn't most of the bundlerepository bundle be teased apart from depending on the shell? -- Steven E. Harris