package cn.lihu.jh.module.ecg;
|
|
import cn.lihu.jh.module.ecg.service.queue.QueueService;
|
import org.springframework.boot.context.event.ApplicationStartedEvent;
|
import org.springframework.context.ApplicationListener;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
|
@Component
|
public class MySpringEventLister implements ApplicationListener<ApplicationStartedEvent> {
|
|
@Resource
|
private QueueService queueService;
|
|
@Override
|
public void onApplicationEvent(ApplicationStartedEvent event) {
|
System.out.println("应用启动完成,通知监听器执行缓存预加载操作");
|
queueService.initQueue();
|
}
|
}
|