final ScheduledExecutorService scheduledExecutorService=Executors.newScheduledThreadPool(1);

scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
Map<Integer, Province> allMapProvince = iRedisService.getAllProvince();
provincesHashMap.putAll(allMapProvince);
citiesHashMap.putAll(loadCityProvinceData(allMapProvince));
logger.info("scheduledExecutorService.scheduleAtFixedRate.run,data:{}",JSON.toJSONString(allMapProvince));
}
},0,5,TimeUnit.MINUTES);
posted on 2016-12-20 15:36  xuxu_dragon  阅读(900)  评论(0编辑  收藏  举报