Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 15016 invoked from network); 8 Apr 2004 14:49:36 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 8 Apr 2004 14:49:36 -0000 Received: (qmail 25714 invoked by uid 500); 8 Apr 2004 14:49:27 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 25592 invoked by uid 500); 8 Apr 2004 14:49:26 -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 Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 25578 invoked from network); 8 Apr 2004 14:49:26 -0000 Received: from unknown (HELO warden.diginsite.com) (208.29.163.248) by daedalus.apache.org with SMTP; 8 Apr 2004 14:49:26 -0000 Received: from wlvims01.diginsite.com by warden.diginsite.com via smtpd (for daedalus.apache.org [208.185.179.12]) with SMTP; Thu, 8 Apr 2004 07:49:18 -0700 Received: from WLVIMS01 ([127.0.0.1]) by WLVIMS01.digitalinsight.com (Post.Office MTA v3.5.3 release 223 ID# 0-0U10L2S100V35) with SMTP id com for ; Thu, 8 Apr 2004 07:49:18 -0700 Received: by calexc01.diginsite.com with Internet Mail Service (5.5.2657.72) id <22RFFMWN>; Thu, 8 Apr 2004 07:48:17 -0700 Message-ID: <31DF72A980E5D511B48C000102BD8685061DB306@calexc01.diginsite.com> From: Ralph Goers To: "'dev@cocoon.apache.org'" Subject: RE: [Kernel22] How to develop a component? Date: Thu, 8 Apr 2004 07:48:17 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Sorry, but this cannot work. Calling comp.ensureWired() accomplishes nothing because the component could be dropped between completion of that call and the next. This whole idea will create the ugliest client code you have ever seen, because each and every operation could fail, in which case you will have to start over again from the beginning, or fail the whole thing (and probably make somebody else retry the whole thing). I'm with Sylvain on this one. Don't get rid of the block until it is released. Ralph -----Original Message----- From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de] Sent: Thursday, April 08, 2004 7:38 AM To: dev@cocoon.apache.org Subject: RE: [Kernel22] How to develop a component? Believe me, I'm really just curious. Would the new code be the same or just similar? Of course the lookup is different as a different method is used. From what I understood the code would look like this: StatefulComponent comp = (StatefulComponent)wire.lookup(StatefulComponent.class, SOMEHINT); try { comp.login (); // (1) comp.doOperation (); comp.logout (); } finally { wire.release (comp); } > > The new "Block" code uses Wirings instead of a > ComponentManager/ServiceManager, but they are *very* similar. > You should also include a > comp.ensureWired() call > at the top, to test if the block whose components you are > using hasn't been reloaded since you last checked. (This call > will also reload the block if it is scheduled for reload, but > not yet reloaded). So, would I do a comp.ensureWired() before each call to the component? > > ***The biggest change however***, is that you have to be > prepared for the event that a component that you have looked > up may disappear due to block reloading. > > This simply did not happen with Avalon. So you may get an > exception where you didn't get one before. > > Otherwise you should be fine. > So, if I understand you correctly, the only difference is that I can get an exception that I wasn't prepared to get when using Avalon. If that's try then I don't see any reason why this wouldn't work with using the Avalon interfaces - I'm just speaking of the interfaces not the implementation! Carsten