Imagine that I want to ensure that class is instantiated upon deployment in Tomcat of the war it is contained in.
For example a class has a static initializer that launches a thread that periodically prints the CPU usage. I need this class to start monitoring as soon as the Tomcat loads the war.
Is there a way to do this without having to call a Servlet that has a reference to this class so the ClassLoader loads it and the static initializer is executed?