Callback on Tomcat server startup complete

后端 未结 2 1091
广开言路
广开言路 2021-01-20 01:54

Is there any mechanism, lifecycle event or callbacks, in Spring or Tomcat to notify once Tomcat server startup is completed? (I have 8 web applications and queues configured

2条回答
  •  深忆病人
    2021-01-20 02:21

    In case someone wants to do it programmatically (if using embedded Tomcat for example):

    Tomcat tomcat = new Tomcat();
    ...
    tomcat.getServer().addLifecycleListener(new KPTomcatListener());
    tomcat.start()
    

提交回复
热议问题