* Created by litao on 15/12/29.
*/
@Component("initTagDataProcessor")
public class InitTagDataProcessor implements ApplicationListener<ContextRefreshedEvent> {
private static Logger logger=Logger.getLogger(InitTagDataProcessor.class);
@Autowired
private AppTagCollectionService appTagCollectionService;
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if(event.getApplicationContext().getParent() == null){//root application context 没有parent,他就是老大.
//初始化tag
logger.info("start init tag data");
appTagCollectionService.loadTagData();
logger.info("finish init tag data");
}
}
}