tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [5.0] Listeners change
Date Sat, 09 Aug 2003 17:36:12 GMT
On Sat, 9 Aug 2003, Remy Maucherat wrote:

> Date: Sat, 09 Aug 2003 15:29:09 +0200
> From: Remy Maucherat <remm@apache.org>
> Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> Subject: [5.0] Listeners change
>
> Right now, all the webapp events are put in a single array. As some
> events are invoked in the critical path, this is not very efficient. The
> model was designed for Tomcat 4.0, with the old servlet API in mind, and
> it obviously used the fact that few events were sent.
>
> As a result, I propose splitting the listeners in two arrays, so:
>
> applicationListeners ->
>
> 1) applicationLifecycleListeners: lifecycle of the webapp and session
> (relatively low even rate)
>
> 2) applicationEventListeners: everything else (session and request
> modification, notification of request creation and destruction, etc)
>
> The most important is that using a listener for lifecycle is very common
> (and a very good practice IMO), and shouldn't have a performance hit,
> while the second category would be used for fine control or in debug mode.
>
> Comments ?
>

Makes sense, but don't forget that a listener class can implement more
than one interface, so you might have to put the same instance on both
lists.

> Remy

Craig

Mime
View raw message