日期:2014-05-16 浏览次数:20444 次
public class InitRedisCache implements SmartLifecycle{ @Override public void start() { // TODO Auto-generated method stub } @Override public void stop() { // TODO Auto-generated method stub } @Override public boolean isRunning() { // TODO Auto-generated method stub return false; } @Override public int getPhase() { // TODO Auto-generated method stub return 0; } @Override public boolean isAutoStartup() { // TODO Auto-generated method stub return true; } @Override public void stop(Runnable callback) { // TODO Auto-generated method stub }
@Lazy(false) @Repository public class InitRedisCache implements ApplicationListener{ @Autowired @Qualifier("dictionaryService") private DictionaryService dictionaryService; @Autowired @Qualifier("redisService") private RedisService redisService; @Override public void onApplicationEvent(ApplicationEvent event) { if(event instanceof InitEvent){ initDictionaryData(); } } public void initDictionaryData(){ } }