Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 87782 invoked by uid 500); 19 May 2003 13:14:02 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 87766 invoked from network); 19 May 2003 13:14:01 -0000 Received: from mail.s-und-n.de (212.8.217.2) by daedalus.apache.org with SMTP; 19 May 2003 13:14:01 -0000 Received: from mail.s-und-n.de (localhost [127.0.0.1]) by mail2.s-und-n.de (postfix) with ESMTP id 3DE47AC76C for ; Mon, 19 May 2003 15:14:02 +0200 (CEST) Received: from notes.sundn.de (ntsrv5.sundn.de [10.10.2.10]) by mail.s-und-n.de (postfix) with ESMTP id 248C2A2F68 for ; Mon, 19 May 2003 15:14:02 +0200 (CEST) Received: from hw0386 ([10.10.2.34]) by notes.sundn.de (Lotus Domino Release 5.0.8) with SMTP id 2003051915140135:122536 ; Mon, 19 May 2003 15:14:01 +0200 From: "Carsten Ziegeler" To: Subject: RE: [RT] Access to the object model Date: Mon, 19 May 2003 15:15:23 +0200 Message-ID: MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <487FF56C-89FA-11D7-A398-000393B61B56@apache.org> X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-MIMETrack: Itemize by SMTP Server on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 19.05.2003 15:14:01, Serialize by Router on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 19.05.2003 15:14:01, Serialize complete at 19.05.2003 15:14:01 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Peter Royal wrote: > > On Monday, May 19, 2003, at 06:14 AM, Carsten Ziegeler wrote: > > c) Use the Contextualizable interface and put a "handler" in > > the context object. > > > > Now, the most simple approach is a), but that'S not IoC. - I > > think the cleanest solution is b), but that would require > > a new marker interface. > > > > I currently tend to a), > > > > What do you think? Is is bad to get the object model in > > a custom component? > > I'd say (c). > > You could do a straight dump of the object model into a Context.. > > final DefaultContext objectModelContext = new DefaultContext( > objectModel, parentContext ); > > ContainerUtil.contextualize( objectModelContext, component ); > > .... > > Components then just do: > > Request req = (Request) context.get( "request" ); > I'm not sure if this is working. A component can be thread safe, but each request has an own object model, so I think at least the context must either be thread local (which would not be that efficient) or you must store some kind of thread handler for the object model in the context. Or do I oversee something? Carsten