tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Smith <javadevm...@yahoo.com>
Subject HttpSessionListener beforeSessionDestroyed (Craig, Sean)?
Date Sat, 14 Dec 2002 02:04:42 GMT
Hello Everyone in Java Land,

I want to use beforeSessionDestroyed. Before going off and extending
HttpSessionListener, I decided to see if it'd been done (why reinvent the
wheel?). 

I searched on google for my aptly-named method, and found this:

http://archives2.real-time.com/pipermail/tomcat-devel/2002-March/028610.html

How can I use this? is there an interface for a StandardHttpSessionListener or
something? If so, does beforeSessionDestroyed give me access to the session
that is about to be destroyed?

If not, I propose to make an interface that extends HttpSessionListener and
provides for beforeSessionDestroyed. To do this, I will create and store a list
in application scope. Each session will get added to the list. When a session
is destroyed, I can loop through the list and find out which session expired: 

for(i = 0; i < list.size(); i ++){

        session = list.get(i);

        if(System.currentTimeMillis()
           - session.getLastAccessedTime()
           > session.getMaxInactiveInterval())
                beforeSessionDestroyed(session);

        list.remove(i) = null;
}

Any advice?

Garrett

=====
http://dhtmlkitchen.com/
JSP | Servlets | DHTML 

Garrett Needs A Job

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message