On 11.01.2011 11:43, Martin Petzold wrote:
> with no filter, just the class name of an Interface I get all local
> services, right? 

You get "any" service that the framework returns. I've been under the
impression that all things being equal (ranking, permissions) this is
implementation-dependent. Without any clear hints from a client, "any"
service means just that. :)

> With a filter setting (service.imported=*) I get all
> remote services, right?

Yes. This is what I use for testing my RSA stack when I want to enforce
remoteness.

> I would like to have a filter which matches all local services of an
> Interface AND all remote services of this Interface. BUT if the local
> service is also a remote service (service provider in the same OSGi
> framework) I don't want this to be duplicate (in this case I would like
> to have the local one only). I can't figure it out at the moment, is
> this possible?

select service from OSGi where mumble not in (select..) - oh wait :-)

I don't think LDAP expressions can do this, so you would have to get
both local and remote services separately, and then pick one based on
client preference. Maybe create a ServiceTracker that does this for you
and keeps "the best choice" up to date, according to some selection
strategy.

-h
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to