felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: repoAdmin.discoverResources() parameters
Date Wed, 07 Dec 2011 03:22:57 GMT
On 12/6/11 12:04, Lance Frohman wrote:
> Thanks, we would rather do things the "correct OSGi" way.
> How do applications normally handle this?

It depends. If you are in complete control of everything, then it is 
probably best to add a capability to your plugins so you can quickly 
find them. However, neither approach is inherently better than the 
other, I suppose, just this one is more efficient given the API.

-> richard

> On Mon, Dec 5, 2011 at 9:33 PM, Richard S. Hall<heavy@ungoverned.org>wrote:
>> There really is no way to do this, since (if I understand correctly) you
>> are trying to reverse the capability/requirement model.
>> Normally, you perform a query to find matching capabilities. From what I
>> understand, you want to perform a query to find matching requirements.
>> A similar situation exists for fragments, since the host doesn't know
>> about fragments and fragments have a dependency on the host. This was one
>> of the reasons behind the not-fully-baked "extends" concept in OBR. The
>> idea with extends is that you could find all bundles that "extend" another
>> bundle. Still, to do this, you had to manually go through all bundles and
>> check for "extends" requirements and then determine if it extended your
>> target bundle. Not super great, but it works.
>> So, you'll likely have to do something similar here. Manually go through
>> all bundles and determine which ones are importing your package.
>> An alternative, is to add a "IGB plugin" capability to each of your
>> plugin's OBR resource description, which would contain the version as an
>> attribute. Then you could easily query for all "IGB plugin" capabilities.
>> ->  richard
>> On 12/5/11 15:07, Lance Frohman wrote:
>>> My group is using Apache Felix for plugins for a swing application (IGB),
>>> that has versions released every few months
>>> and we need to match the plugins to the appropriate versions of IGB. We
>>> are
>>> using OBR, but I don't know what parameters
>>> to give the repoAdmin.discoverResources() inside IGB to only receive the
>>> plugins for that version. IGB has a version number,
>>> currently 6.7.0, and in all the plugins, I have an Import-Package for one
>>> of the IGB packages, with the version suffix, like:
>>> Import-Package: com.affymetrix.common;version=**"6.6.0",
>>> now the statement is
>>> Resource[] allResourceArray =
>>> repoAdmin.discoverResources("(**symbolicname=*)");
>>> can anyone tell me what to use as the parameter to only return bundles
>>> with
>>> package com.affymetrix.common fulfilling the current version of the
>>> application?
>>> (the repositories are at
>>> http://bioviz.org/igbserver/
>>> http://research-pub.gene.com/**igb_plugins/<http://research-pub.gene.com/igb_plugins/>
>>> http://research-pub.gene.com/**igb_plugins/development/<http://research-pub.gene.com/igb_plugins/development/>
>>> )
>>> thanks,
>>> Lance
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@felix.**apache.org<users-unsubscribe@felix.apache.org>
>> For additional commands, e-mail: users-help@felix.apache.org

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

View raw message