ÎļþÃû´Ó jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/MySpringEventLister.java ÐÞ¸Ä |
| | |
| | | package cn.lihu.jh.module.ecg; |
| | | package cn.lihu.jh.module.ecg.listener; |
| | | |
| | | import cn.lihu.jh.module.ecg.service.queue.QueueService; |
| | | import org.springframework.boot.context.event.ApplicationStartedEvent; |
| | | import org.springframework.context.ApplicationListener; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Component |
| | | public class MySpringEventLister implements ApplicationListener<ApplicationStartedEvent> { |
| | | public class MySpringEventListener { |
| | | |
| | | @Resource |
| | | private QueueService queueService; |
| | | |
| | | @Override |
| | | @EventListener |
| | | public void onApplicationEvent(ApplicationStartedEvent event) { |
| | | System.out.println("åºç¨å¯å¨å®æï¼éç¥çå¬å¨æ§è¡ç¼åé¢å è½½æä½"); |
| | | queueService.initQueue(); |
| | | queueService.hurryup(); |
| | | } |
| | | } |