Hello everyone,
I need to implement an enhancement in our web application whereby, all active sessions are invalidated when the
Tomcat server, hosting our app, is shutdown.
By searching around, I've discovered that I can utilize the HTTPSessionListener [using a hashtable] to implement my requirement. However, our app will be mostly operating under a high load scenario [users > 1 million], so the overhead of maintaining the hashtable can be quite prohibitive. And also, from prior experience we've seen that the integrity of the data within the hashtable can run into inconsistencies, if the logic around preserving its state is not synchronized properly. This resulted in a performance hit we couldn't really afford.
I was wondering, since Tomcat already does the wonderful job of session maintenance, is there a way our app can leverage any of Tomcat's underlying classes to retrieve all the active sessions at Tomcat shutdown?
I came across an interface - Manager - within Catalina.jar. This interface can apparently be used to retrieve the number of active sessions using a method - findSessions(), but I'm not quite aware of where to find an implementation class for it, and or write my own implementation, so that I can probably connect it with my web app.
Appreciate any help.
[ September 17, 2008: Message edited by: Anirvan Majumdar ]