users@glassfish.java.net

Interrupting a running Servlet

From: <glassfish_at_javadesktop.org>
Date: Tue, 01 Apr 2008 05:39:30 PST

Hi folks!

I'd like to know if and how it's possible to interrupt a running servlet, or better how to tell the servlet to suddenly do something else while it is running. In my case I'm letting the servlet invoke methods of a server-side API written in C. I need to be able to stop the running process started by this API at any time during its execution. This can be done by a "stop"-method in the C-API.

The question is now: Can I just send another HttpRequest to the servlet to trigger the invokation of the "stop"-method or is there some other magic to deal with? I assume the servlet's running in a seperate thread, right? If so, how can I access this thread?

The servlet container is a Tomcat 6.0 alongside an Apache 2.x.

Thanks in advance!

- Thomas
[Message sent by forum member 'stylertim' (stylertim)]

http://forums.java.net/jive/thread.jspa?messageID=267057