Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 78062 invoked from network); 25 Jul 2005 12:05:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Jul 2005 12:05:39 -0000 Received: (qmail 50889 invoked by uid 500); 25 Jul 2005 12:05:35 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 50818 invoked by uid 500); 25 Jul 2005 12:05:34 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 50805 invoked by uid 99); 25 Jul 2005 12:05:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2005 05:05:34 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [66.111.4.28] (HELO out4.smtp.messagingengine.com) (66.111.4.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2005 05:05:28 -0700 Received: from frontend2.messagingengine.com (frontend2.internal [10.202.2.151]) by frontend1.messagingengine.com (Postfix) with ESMTP id 9D48BCC2894 for ; Mon, 25 Jul 2005 08:05:32 -0400 (EDT) X-Sasl-enc: 3JKp+i/opEz2B4/bkMYz7O7i/lr1O4Ou0MCemKgd2pcL 1122293130 Received: from [10.0.0.100] (elfriedeholmes.demon.co.uk [80.177.165.206]) by www.fastmail.fm (Postfix) with ESMTP id B9C29570363 for ; Mon, 25 Jul 2005 08:05:30 -0400 (EDT) Message-ID: <42E4D58A.6000701@odoko.co.uk> Date: Mon, 25 Jul 2005 13:05:30 +0100 From: Upayavira Organization: Odoko Ltd User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [RT] The impact of using OSGi References: <42E4976F.30702@apache.org> <42E4C380.3050601@apache.org> <42E4C59A.50300@odoko.co.uk> <200507251951.37592.niclas@hedhman.org> In-Reply-To: <200507251951.37592.niclas@hedhman.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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 Niclas Hedhman wrote: > On Monday 25 July 2005 18:57, Upayavira wrote: > >>Well, no, it doesn't. OSGi by default doesn't do any dependency >>resolution. Either by package, or by 'block'. In which case, if we use >>Maven for it at build time, we're still stuck with a need for it at >>deploy time, which seems a little odd. > > There are a few issues in play here; > 1. Depending on Services. > 2. Depending on specific bundles. > 3. Depending on Java interfaces, not "owned" by the current bundle. Yup. Now, in Cocoon's 'sitemap blocks', as Stefano defined them, a block is identified by its namespace, and blocks depend upon each other via these namespaces. I'm not yet sure whether we can implement that kind of dependency management using point 2 above or not. I hope so! >>Building when you depend on java code in other bundles isn't that easy. >>For one, you may depend upon java classes which are in a jar embedded >>within another jar. > > 3. I think it is expected that classes that a Bundle depends on for its on > instantiation and execution, is distributed with it (or referenced in the > Manifest to a global resource (probably not recommended but possible). I don't understand quite how this could work. After all, if one bundle depends upon another, if that bundle includes its dependency within it, hasn't that killed all benefit? Or must it just include the interface that its dependency bundle implements? Is that what you mean? >>Secondly, the bundle you >>are depending upon might only export some of its classes. Ant can't >>specify only certain classes in its classpath (I dunno if Maven can >>handle this). > > OSGi doesn't Import/Export classes, it only imports/exports packages. And by > using differnt in Ant, you can make the distinction. See [1]. I would assume this is R4 syntax, although I can't be sure. >>So, the only solution we were able to come up with was to >>explode the dependency bundle's jar, only extracting the exported >>classes/interfaces. > > Not sure what you mean here. > > It seems to be a common pattern that a Bundle Jar has the "third-party > dependencies" in embedded Jars, while the classes "owned" by that Bundle sits > in the Jar root. This makes compiling easy and distribution harder, since you > probably want the exported classes from a Bundle to be inside your bundle. Sorry, don't get why this makes distribution harder. > I think there is room for a lot of improvement in the global OSGi community > about this. For instance, exported classes could (should?) be published as > Maven artifacts, and be referenced in the Manifest as artifact: URLs (I have > this working locally), and OSGi will resolve at runtime which bundle actually > exposes the exported classes. Doesn't it do this already? How does Maven add something here? >>This seems to me to be an OSGi specific problem, which, to my mind, >>would be best sorted in an OSGi context. > > Agree. Cocoon should probably forward "usage issues" to the incubating Oscar > project, and until that settles, the migration from a single Cocoon bundle to > use OSGi bundles in Cocoon will be somewhat 'icky'. Yup. Move a few Cocoon devs over to Oscar and get the project going. Only problem is I haven't managed to get Cocoon to run with Oscar yet :-( Regards, Upayavira [1] http://oscar.objectweb.org/oscar-alpha.html#export-filters