Costin, (et. al.)
Getting the session count from the /admin app worked pretty well...
BUT, I've got multiple Tomcats in a load balance and I need to access a _specific_ instance.
My problem: gracefully remove a Tomcat box from the list for maintenance.
Solution: Dan Milstein is adding my patch to mod_jk. It forces an instance of Tomcat in the load balance list to reject new connections, but continue to service existing sessions. (by setting worker.name.active=0, and restarting my apaches)
That's half the battle, now I need to know when all the sessions are ended. (Without having Tomcat specific code in my servlets...)
I was hoping to send a SIGUSR1 through the JVM, but that is a platform dependant signal...
Then I looked at StopTomcat.java...
I created SignalTomcat.java (based on StopTomcat) and modified Ajp12ConnectionHandler.java (and others) to accept a USR1 (int 16) and return the active session count back down the socket. This is called through the command 'tomcat.sh send 16'
I guess my question is: what do you think (of the idea)? Is anyone else needing this same funcionality? Is there a better way?
In regards to distributed sessions; How will/would/should the distributed sessions handle an inactive Tomcat, or what will happen to the distributed sessions when a TC is remove from the list?
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 06, 2001 1:49 PM
> To: tomcat-dev (E-mail)
> Subject: Re: acive session count?
>
>
> > 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 can take a look at the /admin application - there is code
> to access
> the Request and from there you can access the ContextManager, all
> Interceptors, etc.
>
> The mechanism for accessing Request is greatly enhanced in 3.3 ( and a
> taglib is provided ), but 3.2 and 3.1 should work as well.
>
> Costin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>