How can one Servlet Stop (and Re-Start) another Servlet?

Ryan Breidenbach

[I am using JRun's JrunScheduler, but I need to re-start it whenever I modify it's Event.ini file. Any ideas?]

A servlet's life-cycle is determined by the servlet container. Therefore, when the life-cycle methods(init, service and destroy) are called is determined by the container. So, unless your container - in this case JRun - provides specific hooks to do this, you can't.

One question you may want to ask yourself is why you want to do this. Why do you want to restart a servlet? If you are restarting a servlet in order to refresh a cache or reload the state of something, you may want to move this functionality into another the class. That way, you can restart/refresh what ever class you need without depending upon a servlet's life-cycle.

Hope this helps.