tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Knowles <Josh.Know...@worldwidepackets.com>
Subject RE: Active servlet threads?
Date Tue, 16 Oct 2001 17:09:37 GMT
If all you are using it for is to check and see if there are any active
users couldn't you just use the Manager feature of Tomcat 4.0 to check
active sessions?

~josh

-----Original Message-----
From: prs05@prosa.com [mailto:prs05@prosa.com]
Sent: Tuesday, October 16, 2001 5:13 AM
To: tomcat-user@jakarta.apache.org
Subject: Active servlet threads?


Hi!
  I'd like to know the number of currently active threads of a servlet from
within that very servlet... I don't know if I've explained well: I'd like to
make a method that counts the active threads, to know in a certain moment
how many "servlet copies" are running. I'll use this da<tum to determine if
there aren't anyone, and so I can stop the service (or do anything else)
without anyone complaining and without any delay in waiting the other
threads to finish.
  Is it possible? I tried with
Thread.CurrentThread().getThreadGroup().activeCount(), but it gives me 32,
that I guess is the number of the pooled threads, of all the servlet, not
only this very one...
  may you help me? Thanks!
   Germano

Mime
View raw message