Return-Path: Delivered-To: apmail-click-commits-archive@www.apache.org Received: (qmail 82049 invoked from network); 12 Oct 2010 11:05:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Oct 2010 11:05:15 -0000 Received: (qmail 98970 invoked by uid 500); 12 Oct 2010 11:05:15 -0000 Delivered-To: apmail-click-commits-archive@click.apache.org Received: (qmail 98946 invoked by uid 500); 12 Oct 2010 11:05:14 -0000 Mailing-List: contact commits-help@click.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@click.apache.org Delivered-To: mailing list commits@click.apache.org Received: (qmail 98937 invoked by uid 99); 12 Oct 2010 11:05:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 11:05:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Oct 2010 11:05:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E20FE23889BF; Tue, 12 Oct 2010 11:04:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1021740 - /click/trunk/click/framework/src/org/apache/click/ClickServlet.java Date: Tue, 12 Oct 2010 11:04:49 -0000 To: commits@click.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101012110449.E20FE23889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sabob Date: Tue Oct 12 11:04:49 2010 New Revision: 1021740 URL: http://svn.apache.org/viewvc?rev=1021740&view=rev Log: lookup ThreadLocal Context only once inside method Modified: click/trunk/click/framework/src/org/apache/click/ClickServlet.java Modified: click/trunk/click/framework/src/org/apache/click/ClickServlet.java URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/ClickServlet.java?rev=1021740&r1=1021739&r2=1021740&view=diff ============================================================================== --- click/trunk/click/framework/src/org/apache/click/ClickServlet.java (original) +++ click/trunk/click/framework/src/org/apache/click/ClickServlet.java Tue Oct 12 11:04:49 2010 @@ -1125,11 +1125,12 @@ public class ClickServlet extends HttpSe */ @SuppressWarnings("deprecation") protected void processPageOnDestroy(Page page, long startTime) { + Context context = page.getContext(); if (page.hasControls()) { // notify callbacks of destroy event // TODO check that exceptions don't unnecessarily trigger preDestroy - ControlRegistry.getThreadLocalRegistry().processPreDestroy(page.getContext()); + ControlRegistry.getThreadLocalRegistry().processPreDestroy(context); List controls = page.getControls(); @@ -1154,7 +1155,7 @@ public class ClickServlet extends HttpSe // Reset the page navigation state try { // Reset the path - String path = page.getContext().getResourcePath(); + String path = context.getResourcePath(); page.setPath(path); // Reset the forward @@ -1175,9 +1176,9 @@ public class ClickServlet extends HttpSe page.onDestroy(); if (page.isStateful()) { - page.getContext().setSessionAttribute(page.getClass().getName(), page); + context.setSessionAttribute(page.getClass().getName(), page); } else { - page.getContext().removeSessionAttribute(page.getClass().getName()); + context.removeSessionAttribute(page.getClass().getName()); } if (logger.isTraceEnabled()) {