Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 38974 invoked from network); 16 Sep 2000 20:01:34 -0000 Received: from adsl-63-198-47-229.dsl.snfc21.pacbell.net (HELO costin.dnt.ro) (63.198.47.229) by locus.apache.org with SMTP; 16 Sep 2000 20:01:34 -0000 Received: from localhost (costin@localhost) by costin.dnt.ro (8.9.3+Sun/8.9.1) with ESMTP id NAA07600 for ; Sat, 16 Sep 2000 13:03:18 -0700 (PDT) From: cmanolache@yahoo.com X-Authentication-Warning: costin.dnt.ro: costin owned process doing -bs Date: Sat, 16 Sep 2000 13:03:18 -0700 (PDT) X-Sender: costin@costin.dnt.ro To: tomcat-dev@jakarta.apache.org Subject: TC3: proposal - Interceptors Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi, I am still reviewing the core and attempting to make it "as simple as possible but not simpler". I did a small refactoring of interceptors ( including individual chains for each hook and the ability to add only the interceptors that are interested in a certain callback). The implementation doesn't require any change in user code, it's another nice reflection hack ( detect if a certain method is overriden). It seems that most interceptors are extending BaseInterceptor - and please let me know if you are not doing so. My proposal is: 1. Deprecate RequestInterceptor and ContextInterceptor ( as interfaces), keep only BaseInterceptor. All 3 implement the same concepts - chain of command and strategy pattern, and having a single interface will simplify future evolution ( see next ). There is little or no impact on existing code. I also think it will be easier to understand and document, and more consistent with the rest of tomcat. 2. In time, add event/listener model interfaces for all context level events. That will have minimal impact on performance ( since the callbacks happen at startup or on admin changes ). The 2 models can work in paralel until the interceptors are rewritten. This will provide a simpler and more familiar model. So far I'm thinking about: package org.apache.tomcat.core.events ContextEvent, ContextListener, ServerEvent, ServerListener, EventManager. ( the reason for (1) is that the code to manage hooks using BaseInterceptor as base class and detect if the method is overriden is much simpler, and it's more consistent with the rest of tomcat3. ) Costin