tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Retrieving all active sessions
Date Fri, 17 Jul 2009 05:44:08 GMT
> From: sanchit.sriv [mailto:Sanchit.Srivastava@morganstanley.com]
> Subject: Retrieving all active sessions
> 
> 
> I need to write a Servlet or some kind of java program (which 
> may be deployed as part of a webapp on the same container) that
> can get me the count of all active sessions on that tomcat
> Also if possible, active sessions per context path

Rather than mucking around with the internals of Tomcat, implement an HttpSessionListener
for each webapp of interest; see the servlet spec for details about event listeners.  You
could also write a Tomcat-specific valve at the <Engine>, <Host>, or <Context>
level, but that ties you to a specific version of Tomcat.

The session information is also available via JMX.

If you want a webapp that already does it, look at Lambda Probe:
http://lambdaprobe.org

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message