Return-Path: Delivered-To: apmail-karaf-user-archive@minotaur.apache.org Received: (qmail 35455 invoked from network); 8 Dec 2010 21:58:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Dec 2010 21:58:43 -0000 Received: (qmail 74529 invoked by uid 500); 8 Dec 2010 21:58:42 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 74472 invoked by uid 500); 8 Dec 2010 21:58:42 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 74464 invoked by uid 99); 8 Dec 2010 21:58:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Dec 2010 21:58:42 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.158.227.200] (HELO mail.peoplenetonline.com) (208.158.227.200) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Dec 2010 21:58:38 +0000 Received: from mail.peoplenetonline.com (127.0.0.1) by mail.peoplenetonline.com (MlfMTA v3.2r9) id hvvt840171sr for ; Wed, 8 Dec 2010 15:36:46 -0600 (envelope-from ) Received: from EXCHANGE01.peoplenetonline.com ([10.10.10.222]) by mail.peoplenetonline.com (SonicWALL 7.2.0.2635) with ESMTP; Wed, 08 Dec 2010 15:36:46 -0600 Received: from Exchange.peoplenetonline.com ([fe80::18fd:8bd8:2b71:d8f7]) by EXCHANGE01.peoplenetonline.com ([::1]) with mapi; Wed, 8 Dec 2010 15:58:17 -0600 From: Brad Beck To: "user@karaf.apache.org" Date: Wed, 8 Dec 2010 15:58:16 -0600 Subject: RE: Inspecting referenced services for a bundle... Thread-Topic: Inspecting referenced services for a bundle... Thread-Index: AcuXIJxsVhIXAAhaSbqVD4oQw53zzgAAi2tw Message-ID: <3C9C5AF13C9B304B8C359A76756824291EBF90E22E@EXCHANGE.peoplenetonline.com> References: <3C9C5AF13C9B304B8C359A76756824291EBF90E1B3@EXCHANGE.peoplenetonline.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mlf-Version: 7.2.0.2635 X-Mlf-UniqueId: o201012082136450060167 Thanks! The following worked for me in 2.1.0... bundlesProvidingServices =3D { services =3D (getBundle $1) servicesInUse ;= bundles =3D new java.util.LinkedHashSet ; each $services { $bundles add (= $it bundle) } ; $bundles } -----Original Message----- From: Guillaume Nodet [mailto:gnodet@gmail.com]=20 Sent: Wednesday, December 08, 2010 3: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 =3D { services =3D ($.context . getBundle $1) . servicesInUse ; bundles =3D 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 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 providi= ng the services. > > Thanks, > -Brad > > --=20 Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com