Well, anything that accesses Tomcat internals is going to be Tomcat-specific ...I need to get a count of the number of active sessions in an instance of Tomcat.
Was hoping it could be a flag (Tomcat -getSessionCount) or the like, so I've been looking at adding a getSessionCount() method from the StandardManager, through to Tomcat... But I need to get the ContextManager for the running instance. And that isn't stored as a static.
Is this info available through other avenues? Any solutions/ Pointers in the right direction?
You might consider one of the following approaches:
* Under Tomcat 3.2 (servlet 2.2 API), have your application always
install an object of a particular class in the user's session
when
they log on. Have this class implement HttpSessionBindingListener.
Then, you can accumulate and maintain a list (or count, or whatever)
of the active sessions.
* Under Tomcat 4.0 (servlet 2.3 API), implement an application events
listener that hears about all session creations and destructions.
This
works without even needing cooperation from other parts of your
app
to make sure they install an HttpSessionBindingListener object.
Craig McClanahan
Thanks,
mk