tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject TC3: proposal - Interceptors
Date Sat, 16 Sep 2000 20:03:18 GMT

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:
   ContextEvent, ContextListener, ServerEvent, ServerListener,

( 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. )


View raw message