In applications, one sometimes needs to run some processes before and after the application’s run. Whereas in an application server you have full access to the web application lifecycle through the javax.servlet.ServletContextListener interface, there is no such thing in a plain old Java application. Doing things before is easy enough since you have access to the application’s entry point in the form of the public void main(String[] args) method. But how do you things after? Where i