Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 73720 invoked from network); 14 Feb 2007 07:38:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Feb 2007 07:38:29 -0000 Received: (qmail 11220 invoked by uid 500); 14 Feb 2007 07:38:37 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 11147 invoked by uid 500); 14 Feb 2007 07:38:36 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 11134 invoked by uid 99); 14 Feb 2007 07:38:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 23:38:36 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 23:38:28 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id B59C81A981A; Tue, 13 Feb 2007 23:38:07 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r507427 - in /cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components: DefaultAuthenticationManager.java DefaultHandlerManager.java Date: Wed, 14 Feb 2007 07:38:07 -0000 To: cvs@cocoon.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070214073807.B59C81A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cziegeler Date: Tue Feb 13 23:38:06 2007 New Revision: 507427 URL: http://svn.apache.org/viewvc?view=rev&rev=507427 Log: Lazy initialization. Possible fix for #COCOON-1987 Modified: cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java Modified: cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java?view=diff&rev=507427&r1=507426&r2=507427 ============================================================================== --- cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java (original) +++ cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java Tue Feb 13 23:38:06 2007 @@ -101,12 +101,15 @@ /** The map containing the handler configurations for this sitemap. */ protected Map handlerConfigs; + /** The handler configuration. */ + protected Configuration configuration; + /** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ public void configure(Configuration config) throws ConfigurationException { Deprecation.logger.warn("The authentication-fw block is deprecated. Please use the auth block instead."); - this.handlerConfigs = DefaultHandlerManager.prepareHandlerConfiguration(ContextHelper.getObjectModel(this.context), config); + this.configuration = config; } /** @@ -115,6 +118,14 @@ private Map getHandlerConfigurations() throws ProcessingException { // TODO - we have to find a way to get the parent handlers! + // we have to do a lazy initialization as we need an object model (request) + if ( this.handlerConfigs == null ) { + synchronized ( this ) { + if ( this.handlerConfigs == null ) { + this.handlerConfigs = DefaultHandlerManager.prepareHandlerConfiguration(ContextHelper.getObjectModel(this.context), this.configuration); + } + } + } return this.handlerConfigs; } Modified: cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java?view=diff&rev=507427&r1=507426&r2=507427 ============================================================================== --- cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java (original) +++ cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultHandlerManager.java Tue Feb 13 23:38:06 2007 @@ -40,8 +40,12 @@ */ static public Map prepareHandlerConfiguration(Map objectModel, Configuration configs) - throws ConfigurationException { - return prepare( objectModel, configs ); + throws ProcessingException { + try { + return prepare( objectModel, configs ); + } catch (ConfigurationException ce) { + throw new ProcessingException("Exception during handler configuration.", ce); + } } /** * Prepare the handler configuration