SpringApplicationRunListener 作用
SpringApplicationRunListener 可以监听springboot应用启动过程中的一些生命周期事件,并做一些处理
查看SpringApplicationRunListener 定义
/**
* Called immediately when the run method has first started. Can be used for very
* early initialization.
*/
void starting();
/**
* Called once the environment has been prepared, but before the
* {@link ApplicationContext} has been created.
* @param environment the environment
*/
void environmentPrepared(ConfigurableEnvironment environment);
/**
* Called once the {@link ApplicationContext} has been created and prepared, but
* before sources have been