You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/03/08 18:21:38 UTC
DO NOT REPLY [Bug 33589] -
stop a context without interrupting its running threads
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33589>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=33589
lionel.farbos@free.fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WONTFIX |
------- Additional Comments From lionel.farbos@free.fr 2005-03-08 18:21 -------
I tried what you suggest me (hack my code to wait more).
To do so, I implement a MotherServlet and all the servlets inherit to it.
MotherServlet below :
public abstract class MotherServlet extends HttpServlet
{
private static final Object lock = new Object();
private static int nbActifsThreads = 0;
...
protected void service(HttpServletRequest request, HttpServletResponse
response) throws IOException, ServletExcepti
on
{
synchronized (lock) { nbActifsThreads++; }
try {
super.service(request, response);
}
finally {
try {
response.flushBuffer();
}
catch (IOException e) {
log( "exception", e );
}
}
synchronized (lock) { nbActifsThreads--; }
}
public synchronized void destroy()
{
while (nbActifsThreads >0) {
try { Thread.sleep(100); } catch (Exception e) {}
}
super.destroy();
}
}
It works for me.
But, now, the problem is :
If I want to force a stop Context, how to do it ?
The destroy doesn't know if I want a graceful stop or a force stop ...
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org