java - How to stop Embedded Tomcat gracefully and tomcat should get stopped only after the current processing requests have to complete -


we have implemented embedded tomcat model java application. , running war file java -jar command. problem how can stop server. , before server getting stopped, fired requests server should processed. have stop server. how can implement this. in advance.

make application when finished write file /somedir/yoursecretfile

if using linux, make cron job check periodically if file /somedir/yoursecretfile exist , if file exists, stops web server (maybe ps | grep | xargs or that).

if using other os, use replacement cron os , script stops webserver.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -