tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin.Manola...@eng.sun.com
Subject Cleanup: sessions
Date Fri, 07 Jan 2000 20:06:21 GMT
Hi,

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
rollback.

-  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
interface.

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

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

- SessionInterceptor ( the default == the current code ) will call the
session
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
like
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!)

Costin


Mime
View raw message