tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject [Tomcat 4] Session Handling Enhancements
Date Tue, 06 Feb 2001 00:40:50 GMT
The session handling enhancements proposed by Kief Morris
<> have been committed on the Tomcat 4.0 CVS
repository.  On an initial review, I plan to make the following changes,
and welcome additional thoughts and comments:

(1) Session Save/Restore Across App Restarts

Currently, StandardManager saves and restores sessions across app
restarts (i.e. autoreload if turned on, or normal shutdown and
startup).  It should be modified to use the new passivate() and
activate() methods of the session implementation to warn interested
session attributes that this activity is taking place.

(2) Modify StandardSession.readObject() and writeObject()

Currently, when the session is being serialized, the attributes are
removed via removeAttribute() -- which triggers calls to valueUnbound()
of attributes that implement HttpSessionBindingListener, among other
things.  Likewise, when the session is reloaded in readObject,
setAttribute() is called and triggers calls to valueBound().  These
calls were initially made to give session attributes some knowledge that
a restart was being done.

Now that the activate and passivate mechanisms are in place, I propose
that these mechanisms be changed to *not* unbind and bind the attributes
during these processes.  Any interested attribute can implement
HttpSessionAttributeListener instead.

(3) Change "final" classes

One of the challenges Kief ran into is that StandardManager and
StandardSession are both marked final, and therefore cannot be
subclassed.  I propose to remove the "final" modifier so that this
restriction is no longer in place.  Additional refactoring can be
performed separately, but you should at least be able to subclass these


View raw message