How to check if thread is killed or keep running when you stop the tomcat Server?

Barnwal Vivek

I have a thread pool of 10 threads to serve some task and they are keep running in my web application in tomcat server. I am using the ExecutorService to create Thread Pool as given below.

ExecutorService executor = Executors.newFixedThreadPool(10);

Will these thread be killed or keep running after stopping the tomcat server without executing executor.shutdown()?

Thanks.

Sas

As others have mentioned if you execute tomcat shutdown, it's going to terminate your thread.

However, as per your comment you are trying to gracefully kill your threads. So I think you need to implement your shutdown logic in the ServletContextListener and use the contextDestroyed method.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to stop an executor thread when Tomcat is stopped?

From Dev

How do I stop the thread when tomcat stop

From Dev

How to keep a thread alive forever until JVM is killed?

From Dev

How to check when the app is killed in android nougat?

From Dev

How to check which web server you are running Rails 4

From Dev

How to check if a thread is currently running

From Dev

How to keep service running in background when app is closed but stop/disable it when the app is in foreground?

From Dev

How to keep running a Thread after specific time

From Dev

How come this thread keep running in Spring?

From Dev

How to keep running when hovering?

From Dev

How Ruby/Rails decide when a Thread.current should be killed?

From Dev

How to know, when a shell command running in the backround getting killed or died

From Dev

How can I make sure a program is killed when VPN is running?

From Dev

How to Correctly Check if a Process is running and Stop it

From Dev

Where will code stop running when app is killed from task manager on Android

From Dev

How to keep an activity running to check network?

From Dev

JavaMail stopped working when running on Tomcat server

From Dev

how to stop main thread while another thread still running

From Dev

How to check if thread made by module thread (in Python 3 _thread) is running?

From Dev

A thread that will keep running?

From Dev

How to check if thread is running or completed using swift

From Dev

How to check if thread is running or completed using swift

From Dev

Pycharm : How to forcefully stop a server if it is already running

From Dev

How to push notifications from server when app is killed

From Dev

How to keep server listen running in Grunt task?

From Java

How to keep Laravel Queue system running on server

From Dev

How to keep a process running indefinitely on ubuntu server

From Dev

How does Eclipse know if a Tomcat server is running?

From Dev

How can you stop resending a webpage when the client doesen't return an answer to the server

Related Related

  1. 1

    How to stop an executor thread when Tomcat is stopped?

  2. 2

    How do I stop the thread when tomcat stop

  3. 3

    How to keep a thread alive forever until JVM is killed?

  4. 4

    How to check when the app is killed in android nougat?

  5. 5

    How to check which web server you are running Rails 4

  6. 6

    How to check if a thread is currently running

  7. 7

    How to keep service running in background when app is closed but stop/disable it when the app is in foreground?

  8. 8

    How to keep running a Thread after specific time

  9. 9

    How come this thread keep running in Spring?

  10. 10

    How to keep running when hovering?

  11. 11

    How Ruby/Rails decide when a Thread.current should be killed?

  12. 12

    How to know, when a shell command running in the backround getting killed or died

  13. 13

    How can I make sure a program is killed when VPN is running?

  14. 14

    How to Correctly Check if a Process is running and Stop it

  15. 15

    Where will code stop running when app is killed from task manager on Android

  16. 16

    How to keep an activity running to check network?

  17. 17

    JavaMail stopped working when running on Tomcat server

  18. 18

    how to stop main thread while another thread still running

  19. 19

    How to check if thread made by module thread (in Python 3 _thread) is running?

  20. 20

    A thread that will keep running?

  21. 21

    How to check if thread is running or completed using swift

  22. 22

    How to check if thread is running or completed using swift

  23. 23

    Pycharm : How to forcefully stop a server if it is already running

  24. 24

    How to push notifications from server when app is killed

  25. 25

    How to keep server listen running in Grunt task?

  26. 26

    How to keep Laravel Queue system running on server

  27. 27

    How to keep a process running indefinitely on ubuntu server

  28. 28

    How does Eclipse know if a Tomcat server is running?

  29. 29

    How can you stop resending a webpage when the client doesen't return an answer to the server

HotTag

Archive