Return-Path: Delivered-To: apmail-incubator-felix-dev-archive@www.apache.org Received: (qmail 1367 invoked from network); 15 Nov 2005 17:23:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Nov 2005 17:23:30 -0000 Received: (qmail 47438 invoked by uid 500); 15 Nov 2005 17:23:25 -0000 Delivered-To: apmail-incubator-felix-dev-archive@incubator.apache.org Received: (qmail 47384 invoked by uid 500); 15 Nov 2005 17:23:24 -0000 Mailing-List: contact felix-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: felix-dev@incubator.apache.org Delivered-To: mailing list felix-dev@incubator.apache.org Received: (qmail 47335 invoked by uid 99); 15 Nov 2005 17:23:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2005 09:23:23 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [207.190.94.33] (HELO gadget.mwt.net) (207.190.94.33) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2005 09:23:13 -0800 Received: from [192.168.1.8] (dsl-67-41.westby.mwt.net [207.190.67.41]) by gadget.mwt.net (8.12.11/8.12.11) with ESMTP id jAFHMxkq030185; Tue, 15 Nov 2005 11:22:59 -0600 Subject: Re: Using ServiceTracker From: "John E. Conlon" Reply-To: jconlon@verticon.com To: erodriguez@apache.org Cc: felix-dev@incubator.apache.org In-Reply-To: <4379BC56.4060503@apache.org> References: <1131660106.4079.27.camel@trout> <4373D592.3050900@apache.org> <1131683458.4080.38.camel@trout> <437453F0.9050908@apache.org> <1131754171.4074.80.camel@trout> <4379BC56.4060503@apache.org> Content-Type: text/plain Organization: Verticon, Inc. Message-Id: <1132075378.4098.149.camel@trout> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 15 Nov 2005 11:22:58 -0600 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Tue, 2005-11-15 at 04:45, Enrique Rodriguez wrote: > John E. Conlon wrote: > > On Fri, 2005-11-11 at 02:18, Enrique Rodriguez wrote: > ... > >>In the same way that you are importing 'log' you also need to import > >>'tracker' and since you are using an Activator you'll need 'framework', too. > > > > Up to this point I have not imported org.osgi.framework and finding the > > BundleActivator worked okay (When I did not use the tracker that is, - > > when I just 'manually managed my services.) > > Explicitly importing the org.osgi.framework and org.osgi.util.* classes > > seems counter-intuitive, (of course I'm a beginner still coming up to > > speed.) But one would think all the framework classes should be > > accessible on the parent classloader. Or at least I did with framework. > > Did BJ's explanation make sense? This is core OSGi philosophy. By > requiring the bundle to import what it needs, it can even use a > different framework version from the framework it is running on. Yes it does. (Thanks BJ) > > > I made the change you recommended and now I get: > > [ 12] [Installed ] [ 1] My OSGi Felix Experiment 1 (1.0-SNAPSHOT) > > -> start 12 > > org.osgi.framework.BundleException: Unresolved package in bundle 12: > > org.osgi.util.tracker > > Perfect. Now we're at Long Answer #2, where we need to get bundlized > and Mavenized OSGi jars out there. In other words, your import is now > working but there's no corresponding export. Thought I would test my newly 'fixed' (but now broken felix) bundle in the 3.2.0 equinox osgi implementation. Before the change it did not work in equinox but now it does! (My dream of interoperability is now restored). > >>Long Answer: > ... > > Is the ant right? Or should the org.osgi.util.tracker package be > > included in the osgi.jar? If it was I would expect to find the > > ServiceTracker as it's in the latest src tree and it jar up very easily > > with a added to the jar command. > ... > >>2) The jars coming from OSGi Alliance aren't bundlized, so even if you > >>were importing the right packages, and you had the OSGi jars > >>installed/started, they wouldn't be exporting what you need. I think > >>what we should do is create a wrapper project here at Felix to re-wrap > >>the OSGi jars as bundles and to work with Maven 2. > > > > What is the difference between the org.osgi.util.tracker.ServiceTracker > > in the /lib/osgi.jar and the one that is in > > org.osgi.compendium > > 4.0 > > Why two different jars? > > The presence of the OSGi classes in the Felix framework is largely a > leftover from when Felix R4 started development. Up until mid-October > (when R4 was released) we had to obtain the draft R4 EPL'd sources and > check them into our SVN. The R4 jars are now released from the OSGi > Alliance. This is an example of "make it work" and now we need to "make > it work right." The correct way to import the OSGi packages will be > from the bundlized OSGi jars and we'll work soon to clean up the > framework in SVN. So, no, we won't start include'ing more service or > util packages, we'll work to remove packages in SVN that shouldn't be there. Right. Then your previous comments regarding wrapping these packages: > 2) The jars coming from OSGi Alliance aren't bundlized, so even if > you > were importing the right packages, and you had the OSGi jars > installed/started, they wouldn't be exporting what you need. I think > what we should do is create a wrapper project here at Felix to re-wrap > the OSGi jars as bundles and to work with Maven 2. Would be related to wrapping the other util packages mentioned on the thread 'request for contributions'? > > org.osgi.util.measurement The OSGi Measurement Package. > > org.osgi.util.position The OSGi Position Package. > ... > > It has been brought to my attention that 'measurement' and 'position' > are utility classes provided in the OSGi R4 Compendium jar. I did not > know that. We do not need to re-implement anything, including any of > the other requested contribution packages if they are already > provided. regards, John