Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 92722 invoked from network); 8 Apr 2004 14:12:52 -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:12:52 -0000 Received: (qmail 19788 invoked by uid 500); 8 Apr 2004 14:12:44 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 19752 invoked by uid 500); 8 Apr 2004 14:12:43 -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 19732 invoked from network); 8 Apr 2004 14:12:43 -0000 Received: from unknown (HELO mail.s-und-n.de) (212.8.217.2) by daedalus.apache.org with SMTP; 8 Apr 2004 14:12:43 -0000 Received: from notes.sundn.de (ntsrv5.sundn.de [10.10.2.10]) by mail.s-und-n.de (postfix) with ESMTP id C65F519F671 for ; Thu, 8 Apr 2004 16:12:44 +0200 (CEST) Received: from hw0386 ([10.10.2.54]) by notes.sundn.de (Lotus Domino Release 6.5) with ESMTP id 2004040816060680-40673 ; Thu, 8 Apr 2004 16:06:06 +0200 From: "Carsten Ziegeler" To: Subject: RE: [Kernel22] How to develop a component? Date: Thu, 8 Apr 2004 16:15:04 +0200 Organization: S&N AG MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <005801c41d73$3638c070$0801a8c0@lagrange> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Thread-Index: AcQdclFC+mTIqio6RiGqWNwmW1ogagAAXj/A X-MIMETrack: Itemize by SMTP Server on PBSN1/Systeme und Netzwerke(Release 6.5|September 26, 2003) at 08.04.2004 16:06:06, Serialize by Router on PBSN1/Systeme und Netzwerke(Release 6.5|September 26, 2003) at 08.04.2004 16:06:07, Serialize complete at 08.04.2004 16:06:07 Message-ID: Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" 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 Leo Sutic wrote: > > interface StatefulComponent { > public void login (); // never throws any exception, ever. > public void doOperation (); // never throws any exception, ever. > public void logout (); // never throws any exception, ever. > } > > Client.java: > > StatefulComponent comp = (StatefulComponent) > manager.lookup(StatefulComponent.ROLE); > try { > comp.login (); > // (1) > comp.doOperation (); > comp.logout (); > } finally { > manager.release (comp); > } > > If a block reload of the implementation of StatefulComponent > occurs at (1), the comp proxy will be invalidated while in > use, and the operation will fail. > > This is contrary to Avalon semantics, where a component > reference, once obtained, remains valid until it is released. > > Of course there are ways to code around this (or ignore it) > in the vast majority of cases. > How does the working code look like? Carsten