File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes How to stop a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "How to stop a servlet" Watch "How to stop a servlet" New topic
Author

How to stop a servlet

Bhaskar Selvaraju
Greenhorn

Joined: Jul 04, 2001
Posts: 29
Can someone please tell me how do i stop a server once it has been started i.e after it has been invoking, other than shutting down the server, i am using Apache with Tomcat.
This servlet is doing some extensive work along with some serious logging so it can run from say 10 to 30 mins.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Moving to the Tomcat forum.


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11863
The Tomcat management functions say they can stop a servlet but I don't know if that means stop it from handling any more requests or stop it in the middle of a request.
Any long job should be spun off to a separate Thread and not handled in the request Thread, also your run method has to have frequent checks of some flag to see if it is ok to continue.
Bill


Java Resources at www.wbrogden.com
 
 
subject: How to stop a servlet
 
Threads others viewed
destroy() method
load-on-startup
diff between web server-app server
proxy settings in servlet
2 tier architecture
IntelliJ Java IDE