I am writing a Springboot application embedding Tomcat as a Web Server.
At startup, some of my threads are ready (and so start doing their job) before Tomcat is. For many contraints I have, I want that these threads do nothing before Tomcat is ready
But I don't know how to decided to block/unblock my threads; to do so, I need to be informed of the Tomcat status. Is there:
- a way to ask:
isWebServerStarted()
? - or a way to be notified asynchronously by a message saying:
WEB_SERVER_IS_STARTED
?
Thank you for help
FYI, I don't want to declare a kind of "private ReST endpoint" that my application could try to reach in order to guess whether the webserver is ready