Return-Path: Delivered-To: apmail-incubator-click-dev-archive@minotaur.apache.org Received: (qmail 43293 invoked from network); 29 Dec 2009 03:46:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Dec 2009 03:46:54 -0000 Received: (qmail 25482 invoked by uid 500); 29 Dec 2009 03:46:54 -0000 Delivered-To: apmail-incubator-click-dev-archive@incubator.apache.org Received: (qmail 25440 invoked by uid 500); 29 Dec 2009 03:46:53 -0000 Mailing-List: contact click-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@incubator.apache.org Delivered-To: mailing list click-dev@incubator.apache.org Received: (qmail 25432 invoked by uid 99); 29 Dec 2009 03:46:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2009 03:46:52 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Dec 2009 03:46:50 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 66120234C045 for ; Mon, 28 Dec 2009 19:46:29 -0800 (PST) Message-ID: <121421354.1262058389403.JavaMail.jira@brutus.apache.org> Date: Tue, 29 Dec 2009 03:46:29 +0000 (UTC) From: "Malcolm Edgar (JIRA)" To: click-dev@incubator.apache.org Subject: [jira] Updated: (CLK-598) Add Page Interceptor facility In-Reply-To: <752106658.1261778189483.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CLK-598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Malcolm Edgar updated CLK-598: ------------------------------ Description: Provide an application page interceptor / listener facility into Click. The concept is to provide an extension point for code which can listener to key page events and also interrupt normal page processing flow. Using this code which tends to be incorporated into Page superclasses can be refactored into listener classes which can be reused in applications. This approach supports Page design by composition, rather than through inheritance. Page listeners could be used for: * enforcing an application wide security polity, rather than using the Page#onSecurityCheck() method * dependency injection, see CLK-581 * support page performance profiling and logging The listener interface would be: public interface PageInterceptor { boolean pageCreate(Class pageClass, Context context); boolean postCreate(Page page); boolean preResponse(Page page); void postDestroy(Page page); } Application page interceptor classes would be defined in the click.xml configuration file. Applications could defined multiple interceptor which would be executed sequentially in the order in which there are defined. Lnterceptor could have a scope / lifecycle of request (where by new instances are created for each page request, and are threadsafe), or application (where by a single instance is created and used for all page requests). interceptor can also be configured to have properties which are set after creation. This scope rules equates to Spring prototype and singleton scopes. An example configuration is provided below: was: Provide an application page listener / interceptor facility into Click. The concept is to provide an extension point for code which can listener to key page events and also interrupt normal page processing flow. Using this code which tends to be incorporated into Page superclasses can be refactored into listener classes which can be reused in applications. This approach supports Page design by composition, rather than through inheritance. Page listeners could be used for: * enforcing an application wide security polity, rather than using the Page#onSecurityCheck() method * dependency injection, see CLK-581 * support page performance profiling and logging The listener interface would be: public interface PageListener { boolean pageCreate(Class pageClass, Context context); boolean postCreate(Page page); boolean preResponse(Page page); void postDestroy(Page page); } Application page listeners classes would be defined in the click.xml configuration file. Applications could defined multiple listeners which would be executed sequentially in the order in which there are defined. Listeners could have a scope / lifecycle of request (where by new instances are created for each page request, and are threadsafe), or application (where by a single instance is created and used for all page requests). Listener can also be configured to have properties which are set after creation. This scope rules equates to Spring prototype and singleton scopes. An example configuration is provided below: Summary: Add Page Interceptor facility (was: Provide Page Listener / Interceptor facility) > Add Page Interceptor facility > ----------------------------- > > Key: CLK-598 > URL: https://issues.apache.org/jira/browse/CLK-598 > Project: Click > Issue Type: New Feature > Components: core > Reporter: Malcolm Edgar > Fix For: 2.2.0 > > > Provide an application page interceptor / listener facility into Click. The concept is to provide an extension point for code which can listener to key page events and also interrupt normal page processing flow. > Using this code which tends to be incorporated into Page superclasses can be refactored into listener classes which can be reused in applications. This approach supports Page design by composition, rather than through inheritance. > Page listeners could be used for: > * enforcing an application wide security polity, rather than using the Page#onSecurityCheck() method > * dependency injection, see CLK-581 > * support page performance profiling and logging > The listener interface would be: > public interface PageInterceptor { > boolean pageCreate(Class pageClass, Context context); > boolean postCreate(Page page); > boolean preResponse(Page page); > void postDestroy(Page page); > } > > Application page interceptor classes would be defined in the click.xml configuration file. Applications could defined multiple interceptor which would be executed sequentially in the order in which there are defined. Lnterceptor could have a scope / lifecycle of request (where by new instances are created for each page request, and are threadsafe), or application (where by a single instance is created and used for all page requests). interceptor can also be configured to have properties which are set after creation. This scope rules equates to Spring prototype and singleton scopes. > An example configuration is provided below: > > > > > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.