From user-return-325-apmail-karaf-user-archive=karaf.apache.org@karaf.apache.org Thu Dec 09 09:51:01 2010 Return-Path: Delivered-To: apmail-karaf-user-archive@minotaur.apache.org Received: (qmail 32060 invoked from network); 9 Dec 2010 09:51:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Dec 2010 09:51:01 -0000 Received: (qmail 33866 invoked by uid 500); 9 Dec 2010 09:51:00 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 33788 invoked by uid 500); 9 Dec 2010 09:51:00 -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 33779 invoked by uid 99); 9 Dec 2010 09:51:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 09:50:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [87.98.235.20] (HELO code-house.org) (87.98.235.20) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 09:50:54 +0000 Received: from 79-pra-14.acn.waw.pl ([85.222.49.79] helo=CodeHousePC) by code-house.org with esmtpa (Exim 4.72) (envelope-from ) id 1PQd8y-0006sF-Vb for user@karaf.apache.org; Thu, 09 Dec 2010 10:50:33 +0100 From: =?iso-8859-2?Q?=A3ukasz_Dywicki?= To: References: <3C9C5AF13C9B304B8C359A76756824291EBF90E1B3@EXCHANGE.peoplenetonline.com> In-Reply-To: Subject: RE: Inspecting referenced services for a bundle... Date: Thu, 9 Dec 2010 10:50:36 +0100 Message-ID: <007a01cb9786$88263bd0$9872b370$@org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcuXIJ5BT8UwWxKzQBG3gnFsXgbSbAAZbqVQ Content-Language: pl X-Authenticated: luke.code-house.org X-Complaints-To: abuse@code-house.org X-Spam-Score: -4.1 (----) Do we have somewhere description of constructions which may be used in aliases? We definitely should put this into documentation. Best regards, Lukasz -----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 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 > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ Open Source SOA http://fusesource.com