karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ɓukasz Dywicki <l...@code-house.org>
Subject RE: Inspecting referenced services for a bundle...
Date Thu, 09 Dec 2010 09:50:36 GMT
Do we have somewhere description of constructions which may be used in
aliases? We definitely should put this into documentation.

Best regards,

-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com] 
Sent: Wednesday, December 08, 2010 10:41 PM
To: user@karaf.apache.org
Subject: Re: Inspecting referenced services for a bundle...

Not directly, but if you iterate through those ServiceReference, you
could build such a list.
You can easily create such a function using the following:

root@karaf> bundlesProvidingServices = { services = ($.context .
getBundle $1) . servicesInUse ; bundles = new java.util.LinkedHashSet
; each $services { $bundles . add ($it . bundle)  } ; $bundles }

and then use it:

root@karaf> bundlesProvidingServices 46
   46|Active     |   60|org.ops4j.pax.web.pax-web-runtime (0.8.1)
   56|Active     |   60|org.apache.felix.webconsole (3.1.6)

the output is actually a list of bundles that you can also store in a
variable if you want more infos.
Note that the syntax is for 2.2-SNAPSHOT and it may have sligtly
changed from 2.1.x.  If that's the case, let me know i can help you
port it if you want.

On Wed, Dec 8, 2010 at 22:17, Brad Beck <BBeck@peoplenetonline.com> wrote:
> Is there a way (using the karaf shell) to inspect a bundle (e.g. 123) to
determine which other bundles are providing services to it?
> "bundle 123" shows ServicesInUse, but it doesn't list the bundles
providing the services.
> Thanks,
> -Brad

Guillaume Nodet
Blog: http://gnodet.blogspot.com/
Open Source SOA

View raw message