Return-Path: Delivered-To: apmail-ws-tuscany-dev-archive@locus.apache.org Received: (qmail 81218 invoked from network); 3 Jan 2008 11:03:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jan 2008 11:03:38 -0000 Received: (qmail 94594 invoked by uid 500); 3 Jan 2008 11:03:25 -0000 Delivered-To: apmail-ws-tuscany-dev-archive@ws.apache.org Received: (qmail 94573 invoked by uid 500); 3 Jan 2008 11:03:25 -0000 Mailing-List: contact tuscany-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-dev@ws.apache.org Received: (qmail 94564 invoked by uid 99); 3 Jan 2008 11:03:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2008 03:03:25 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajinisivaram@googlemail.com designates 72.14.252.152 as permitted sender) Received: from [72.14.252.152] (HELO po-out-1718.google.com) (72.14.252.152) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2008 11:03:00 +0000 Received: by po-out-1718.google.com with SMTP id b23so4618795poe.3 for ; Thu, 03 Jan 2008 03:03:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=2qAwEVJK082Ji77yGn6vN32ZkQrFn/DuhIeZ89Djobg=; b=MILpdTXNW+tl+1KVhNkaTeIWLdgxDneEtQ5FZMqthJkG8omnzXx2cxHwB4yVwZscahEPQn6CjBfWD+emhVCyzYs/SPu75pJpgS3ya0ztqZuH5lj4BwKgJKg4sBued7TsZ0vRa/huCKWvmbod+QJ+q+rVi0z6xO3Qyg+Lnof7IiQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=UDVuwrIFQ2TySnJPXpsSTstRrQo9B9E+3Jf76aNPw8dNngLz5wVXwXYrCJAnXz6dz3kzYmUIEZrJPmY6CfoBqJjZl1/+BbnaaNprV339eeRr04BUDDHbgk9kruGFU5wLkMAPQPGNnS01t07RgnGOG69QHHGpMXIWz+7Nk+O5kX8= Received: by 10.140.82.38 with SMTP id f38mr393556rvb.28.1199358184935; Thu, 03 Jan 2008 03:03:04 -0800 (PST) Received: by 10.140.169.6 with HTTP; Thu, 3 Jan 2008 03:03:04 -0800 (PST) Message-ID: Date: Thu, 3 Jan 2008 11:03:04 +0000 From: "Rajini Sivaram" To: tuscany-dev@ws.apache.org Subject: Re: Using contributions in the tutorial, was: Improving the store tutorial module structure In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11343_4260612.1199358184942" References: <4761D396.2070908@apache.org> <4762A137.3040504@gmail.com> <4762FF97.7050200@apache.org> <4769A1F6.7030504@apache.org> <477C287E.6080802@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_11343_4260612.1199358184942 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/3/08, Simon Laws wrote: > > On Jan 3, 2008 12:12 AM, Jean-Sebastien Delfino > wrote: > > > Rajini Sivaram wrote: > > > Sebastien, > > > > > > When I was implementing OSGi bundle contributions, I was very > frustrated > > > about the fact that even though bundles can have cyclic dependencies, > > > bundles with cyclic dependencies could not be added to SCA, if the > > bundles > > > contained SCA artifacts (composites/componentType files). OSGi copes > > with > > > cyclic dependencies because bundles have separate install and start > > methods. > > > So classes need to get resolved only before the start method is > called. > > The > > > bundle is moved to resolved state by the OSGi runtime when its > > dependencies > > > are satisfied, and only resolved bundles can be started. With SCA > > > contributions, when would the composites/componentType files in a > > > contribution get processed, if it is not done when the contribution is > > > added? Class resolution for contributions is lazy, and hence the > > ordering of > > > contributions is only relevant when there are multiple contributions > > > containing the same class. But classes used in SCA composites and > > > componentType files get resolved when those files are processed, and > at > > the > > > moment addContribution is the trigger, requiring all dependent > > contributions > > > containing classes referred to in composites/componentType files to be > > > installed first. If addContribution is not the trigger to process > > > composites, I am not sure what the trigger would be. node.start() for > > the > > > node? What about the domain? Wouldn't it have been much simpler if > > Tuscany > > > had a better lifecycle layer (like OSGi :-))? > > > > > > > > > > > > Thank you... > > > > > > Regards, > > > > > > Rajini > > > > > > > Short answer to a long question :) when a composite is assigned to a > > node: node.setComposite(composite). Shouldn't resolution be associated with a contribution rather than a composite contained within it? When a composite is assigned to a node, should the node find out which contribution it came from and process all composites and componentType files from the contribution? > > > -- > > Jean-Sebastien > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org > > > > Rajini is correct that at the moment when a contribution is added to the > domain (or directly to the node) then it is passed through the > contribution > processor resulting in an in > memory model of the provided contribution. The model isn't "built" and > "activated" until the node is started. > > AFAIUI there is no lifecycle model in the contribution processor. Either > all > the required dependencies are available or they aren't. So, in the case > where dependent contributions are being added separately, they must be > processed in the correct order according to the > sca-contribution.xmlinformation. > sca-contribution.xml is itself provided inside the contribution. > > The domain/node currently assume a user adds contributions incrementally > (there is no bulk load capability). We could consider delaying the > processing until the user trys to start the domain, i.e. you assume that > is > the point they have all of the contributions added that they need. However > I > don't think that helps as how do we know which contribution to process > first. From this thread we are relying on the order of addition. We rely on the order of addContribution only because the contribution is resolved when it is added. If the resolution can be delayed until all the contributions are added (ie. all sca-contribution.xml files are processed first as each addContribution is called, and the composite and componentType files from all contributions are processed later when the domain is started), then the order in which the contributions were added or the order in which they are resolved wont matter (except if there are multiple copies of the same class in different contributions). But with the current APIs where contributions can be added or removed at any time, can you really assume that "start" is the right time to resolve contributions? Sebastien, are the changes you are thinking about going to allow unresolved > contributions to resolve dependencies after initial processing? > > Regards > > Simon > Thank you... Regards, Rajini ------=_Part_11343_4260612.1199358184942--