@Component
@DependsOn({"springContextHolder"})
public class StartRunner implements ApplicationRunner {
ISysSecurityLogService iSysSecurityLogService = (ISysSecurityLogService)SpringContextHolder.getBean(ISysSecurityLogService.class);
HussarCacheManager hussarCacheManager = (HussarCacheManager)SpringContextHolder.getBean(HussarCacheManager.class);
public StartRunner() {
}
public void run(ApplicationArguments args) {
int count = this.iSysSecurityLogService.selectCount(new EntityWrapper());
this.hussarCacheManager.setObject("securitylog_count", "securitylog_count", count);
}
}
https://www.cnblogs.com/baby123/p/11558816.html
ConfigListener implements ServletContextListener
和
AfterStartUpCommand implements CommandLineRunner