Return-Path: Delivered-To: apmail-forrest-svn-archive@www.apache.org Received: (qmail 93794 invoked from network); 15 Sep 2006 18:04:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Sep 2006 18:04:37 -0000 Received: (qmail 29268 invoked by uid 500); 15 Sep 2006 18:04:34 -0000 Delivered-To: apmail-forrest-svn-archive@forrest.apache.org Received: (qmail 29208 invoked by uid 500); 15 Sep 2006 18:04:34 -0000 Mailing-List: contact svn-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Forrest Developers List" List-Id: Delivered-To: mailing list svn@forrest.apache.org Received: (qmail 29175 invoked by uid 99); 15 Sep 2006 18:04:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 11:04:34 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 11:04:33 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2C2FB1A981A; Fri, 15 Sep 2006 11:03:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r446668 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java Date: Fri, 15 Sep 2006 18:03:03 -0000 To: svn@forrest.apache.org From: thorsten@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060915180303.2C2FB1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: thorsten Date: Fri Sep 15 11:03:02 2006 New Revision: 446668 URL: http://svn.apache.org/viewvc?view=rev&rev=446668 Log: FOR-931 General comments about caching enhancements for the dispatcher. Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java?view=diff&rev=446668&r1=446667&r2=446668 ============================================================================== --- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java (original) +++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java Fri Sep 15 11:03:02 2006 @@ -209,6 +209,7 @@ } // FIXME: turn on caching!!! + // doing some testing /** * Generate the unique key. This key must be unique inside the space of this * component. @@ -263,16 +264,20 @@ * Setup the file generator. Try to get the last modification date of the * source for caching. */ + // FIXME: See http://cocoon.zones.apache.org/daisy/documentation/writing/690.html + // Writing Cache Efficient Components + // we have to do all the heavy stuff later and only prepare the basics here, this will + // help enhance caching. I mark them with * public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); localRecycle(); try { - this.dispatcherHelper = new DispatcherHelper(manager); - this.processor = (XPathProcessor) this.manager + if (null==this.dispatcherHelper)this.dispatcherHelper = new DispatcherHelper(manager); + if (null==this.processor)this.processor = (XPathProcessor) this.manager .lookup(XPathProcessor.ROLE); - m_resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE); + if (null==m_resolver) m_resolver= (SourceResolver) manager.lookup(SourceResolver.ROLE); } catch (Exception e) { String error = "dispatcherError:\n Could not set up the dispatcherHelper!\n DispatcherStack: " + e; @@ -294,6 +299,7 @@ getLogger().error(error); throw new ProcessingException(error); } + // * just store the $requestId and do the DOM-reading/storing later String propertyURI= "cocoon://"+requestId+".props"; try { this.defaultProperties = org.apache.forrest.dispatcher.util.SourceUtil @@ -333,6 +339,7 @@ + " For text output where you would not have to use hooks as structurer, the way you want it."; getLogger().warn(warning); } else { + // * just store the $hooksXSL and do the DOM-reading/storing later DOMSource stylesheet = new DOMSource(dispatcherHelper .getDocument(this.hooksXSL)); this.structurerTransformer = dispatcherHelper @@ -352,13 +359,10 @@ * Cleanup the transformer */ private void localRecycle() { - this.processor = null; - this.dispatcherHelper = null; this.contract = null; this.hooksXSL = null; this.structurerTransformer = null; this.insideProperties = false; - this.m_resolver = null; } public void startElement(String uri, String name, String raw,