You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com> on 2013/02/23 08:33:41 UTC

About finding bundle

Hi,

Let's suppose:

I have 2 bundles already started in framework:
1- HiService (interface)
2- HiServiceImpl (a class, an implementation to HiService)

So, I want to find in bundleContext ALL bundle that:

a) has a implemantation of HiService
b) has a specific implementation, as HiServiceImpl

How can I do that? Anyone can help me?

Best regards!

__
*Dhiego** **Abrantes*

Re: About finding bundle

Posted by Holger Hoffstätte <ho...@googlemail.com>.
On 23.02.2013 09:12, Dhiego Abrantes de Oliveira Martins wrote:
> But, I want to find a bundle that contains an specific implementation of
> HiService, in this case is HiServiceImpl.

This is what service properties are for (it's all in the spec). You
don't really want "HiServiceImpl", you want "the service that has a
property which HiServiceImpl matches". Otherwise you might as well not
have service interfaces at all.

hth :)

-h


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


Re: About finding bundle

Posted by Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com>.
Thanks David!

But, I want to find a bundle that contains an specific implementation of
HiService, in this case is HiServiceImpl.

Thanks!
__
*Dhiego** **Abrantes** *


2013/2/23 David Jencks <da...@yahoo.com>

> If you really want the bundle and these classes are the only classes in
> their packages you can examine the bundle wiring.
>
> Usually it is more useful to register each implementation class as a
> service (directly in code, using DS, blueprint, or IPOJO) with suitable
> service attributes and then query for service references matching HiService.
>
> hope this helps
> david jencks
>
> On Feb 22, 2013, at 11:33 PM, Dhiego Abrantes de Oliveira Martins <
> dhiego@dhiegoabrantes.com> wrote:
>
> > Hi,
> >
> > Let's suppose:
> >
> > I have 2 bundles already started in framework:
> > 1- HiService (interface)
> > 2- HiServiceImpl (a class, an implementation to HiService)
> >
> > So, I want to find in bundleContext ALL bundle that:
> >
> > a) has a implemantation of HiService
> > b) has a specific implementation, as HiServiceImpl
> >
> > How can I do that? Anyone can help me?
> >
> > Best regards!
> >
> > __
> > *Dhiego** **Abrantes*
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: About finding bundle

Posted by David Jencks <da...@yahoo.com>.
If you really want the bundle and these classes are the only classes in their packages you can examine the bundle wiring.

Usually it is more useful to register each implementation class as a service (directly in code, using DS, blueprint, or IPOJO) with suitable service attributes and then query for service references matching HiService.

hope this helps
david jencks

On Feb 22, 2013, at 11:33 PM, Dhiego Abrantes de Oliveira Martins <dh...@dhiegoabrantes.com> wrote:

> Hi,
> 
> Let's suppose:
> 
> I have 2 bundles already started in framework:
> 1- HiService (interface)
> 2- HiServiceImpl (a class, an implementation to HiService)
> 
> So, I want to find in bundleContext ALL bundle that:
> 
> a) has a implemantation of HiService
> b) has a specific implementation, as HiServiceImpl
> 
> How can I do that? Anyone can help me?
> 
> Best regards!
> 
> __
> *Dhiego** **Abrantes*


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