バッチ処理のようなことをしたくなることは、ままあると思います。 方法はJavaにかぎらず色々ありますが、アプリケーションサーバで処理したファイルをゴニョゴニョしたくなったのでシステムに組み込むことにした。 import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class HogerTest implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { //Tomcat起動時処理 } public void contextDestroyed(ServletContextEvent event) { //Tomcatシャットダウン時処