@Service
public class Test implements InitializingBean, DisposableBean {
@Override
public void destroy() throws Exception {
System.out.println("执行destroy()");
}
@Override
public void afterPropertiesSet() throws Exception {
System.out.println("执行afterPropertiesSet()");
}
}
项目启动-控制台
四月 11, 2019 9:00:06 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
执行afterPropertiesSet()
[2019-04-11 09:00:10,473] Artifact AsyncMailSend:war exploded: Artifact is deployed successfully
[2019-04-11 09:00:10,473] Artifact AsyncMailSend:war exploded: Deploy took 6,853 milliseconds
项目关闭-控制台
D:\dev\apache-tomcat-7.0.81\bin\catalina.bat stop
Disconnected from the target VM, address: '127.0.0.1:10042', transport: 'socket'
四月 11, 2019 9:00:19 下午 org.apache.catalina.core.StandardServer await
信息: A valid shutdown command was received via the shutdown port. Stopping the Server instance.
四月 11, 2019 9:00:19 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["http-apr-8089"]
四月 11, 2019 9:00:19 下午 org.apache.coyote.AbstractProtocol pause
信息: Pausing ProtocolHandler ["ajp-apr-8222"]
四月 11, 2019 9:00:19 下午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service Catalina
执行destroy()
四月 11, 2019 9:00:19 下午 org.apache.coyote.AbstractProtocol stop
信息: Stopping ProtocolHandler ["http-apr-8089"]
四月 11, 2019 9:00:19 下午 org.apache.coyote.AbstractProtocol stop
信息: Stopping ProtocolHandler ["ajp-apr-8222"]
...