tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <cos...@eng.sun.com>
Subject RE: Tomcat, Catalina, and Java2
Date Tue, 11 Jul 2000 18:09:21 GMT
> > It is possible to integrate Valves, but that will provide 
> > little benefit -
> > Interceptors are much better from many points of view, and that's even
> 
> Please Costin explain this more deeply, i'm curious about that.

Major:
- we have a goal of integrating with web servers. The interceptors are
designed based on major server APIs, and that will allow real integration.
For example using an auth interceptor to control the static resources ( or
the PHP pages ) in apache, and the reverse ( using web server modules as
components in tomcat).

- event based model - interceptors provide a number of callbacks that will
can be called when needed. ( lazzy invocation ). 

- more flexibility - with Valve you just have invoke next. In interceptor
you can control individual pieces.

- extensible - starting tomcat 3.3 we'll probably see multiple interfaces
grouping related callbacks ( maybe with a real Event API ). Look at the
ByteBuffer model. 

As I said, I'm not against including Valves in Tomcat - I am against
droping support for interceptors. I asked many times for a merge, and also
for using common code and keeping only what's different in the arch
separate. As you see, Catalina reinvents everything - it started with new
adapter, now logging, etc. 

Minor:

- interceptors include multiple individual callbacks / event handler. For
example if you need authorization you call an authorization method. In
Vavles you just have one line of invocation that does everything.

- Recursive/iterative - Valve use a recursive pattern, where each valve
controls the next. In Interceptors you have a bit more control.

Costin


Mime
View raw message