tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Cleanup: sessions
Date Fri, 07 Jan 2000 20:06:21 GMT

In order to "modularize" the session management, we need to
do some changes.
Please let me know what you think, and if anyone has a -1 I'll

-  Move all session related stuff out of core ( in tomcat.session ).
This will reduce the number of classes in core and will allow us
to define a clear interface between session stuff and core.

It seems the minimal interface that will keep everythin working is:

interface SessionManager {

    public HttpSession getSession(Request request, Response
response,boolean create);

    public void accessed(HttpSession session);

In order to define a new session management you need to implement this

- Change. Instead of singleton, a SessionManager will be set for each
It's up to the configuration code ( which will be done later) to tune
manager ( the default is the current code until something else is stable

- The SessionManager is _required_ to respect the APIs. Any parameter
is defined by the deployment descriptor will be specified and set up in
SessionManager tuning can be done for things like database persistence,

- SessionInterceptor ( the default == the current code ) will call the
manager of the current context ( and it will be called after the context

is determined ). Feel free to use a different Interceptor if you don't
this model. ( for example Apache may send the session id, and your
interceptor may use a different internal API to mark it as accessed ).
A session interceptor is _required_ in order to mark as accessed the
session ( user doens't have to call getSession() ).

- Internally, tomcat.core will use HttpSession. Your manager can
cast to it's internal implementation ( and it's guaranteed that accessed

will receive the object generated by getSession()).

Let me know what you think, I'll check in later today or tommorow.
( also - read Craig's Tomcat.Next - he's much better at explaining!)


View raw message