Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 48719 invoked from network); 6 Jul 2004 16:40:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Jul 2004 16:40:17 -0000 Received: (qmail 85268 invoked by uid 500); 6 Jul 2004 16:25:06 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 85200 invoked by uid 500); 6 Jul 2004 16:25:06 -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 85187 invoked by uid 99); 6 Jul 2004 16:25:06 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [217.160.230.41] (HELO mout.perfora.net) (217.160.230.41) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 06 Jul 2004 09:25:02 -0700 Received: from minotaur.apache.org[209.237.227.194] (helo=[127.0.0.1]) by mrelay.perfora.net with ESMTP (Nemesis), id 1BhskW-1vdr-0MKyxe-0006GI; Tue, 06 Jul 2004 12:24:52 -0400 Message-ID: <40EAD255.3000600@reverycodes.com> Date: Tue, 06 Jul 2004 12:24:53 -0400 From: Vadim Gritsenko User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [RT] The API for the request object References: <40EA7B58.5010801@apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Jeremy Quinn wrote: > > On 6 Jul 2004, at 11:13, Sylvain Wallez wrote: > >>> Now, the basic mechanism for this could be to scan all attribute >>> values of the request and find out if the value should be cleaned up >>> or not. This could be done by either testing for the usual suspects >>> from Avalon (Disposable, Recyclable) or by defining a new Cocoon >>> specific interface. >>> But perhaps there is a better way? >>> >> >> What about adding a list of ProcessingListeners to the object model, >> which can be augmented by the various components that participate in >> request handling, and is called at particular places such as: >> - processing start (such listeners must be registered in the xconf), >> - sitemap mount, >> - end of pipeline building, >> - start of pipeline execution (differs from the previous one as it >> may not be called if the result is cached) >> - end of pipeline execution >> - end of processing >> >> That would allow e.g. a flowscript to register a listener that closes >> a hibernate session once the processing is terminated, thus allowing >> the same session to be used in the view. >> > > I believe this is already possible with the JXTemplate callback hook: > > catch (return) {session.close ()} > > though there does seem to be a lot of confusion about it and the > syntax is strange ;) I think those listeners are not only for flowscript, but more generic approach. Btw, sendPageAndWait also has a provision for clean up function. Problem is it does not work each time [1]. Vadim [1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108716210425332&w=2