| package com.zy.acs.manager.core.config; | 
|   | 
| import com.zy.acs.manager.core.service.astart.MapDataDispatcher; | 
| import com.zy.acs.manager.manager.service.CodeService; | 
| import com.zy.acs.manager.manager.service.RouteService; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.context.annotation.Bean; | 
| import org.springframework.context.annotation.Configuration; | 
|   | 
| import java.util.concurrent.atomic.AtomicBoolean; | 
|   | 
| @Configuration | 
| public class BootConfig { | 
|   | 
|     public static final AtomicBoolean FULLY_LOADED = new AtomicBoolean(false); | 
|   | 
|     @Autowired | 
|     private CodeService codeService; | 
|     @Autowired | 
|     private RouteService routeService; | 
|   | 
|     @Bean | 
|     public MapDataDispatcher getMapDataDispatcher() { | 
|         MapDataDispatcher dispatcher = new MapDataDispatcher(codeService, routeService); | 
|         String[][] codeMatrix = dispatcher.getCodeMatrix(null); | 
|         dispatcher.initRouteMap(null); | 
|         if (codeMatrix.length > 0) { | 
|             dispatcher.getMapMatrix(null, null); | 
|             dispatcher.getTurnMatrix(null); | 
|             dispatcher.getCdaMatrix(null); | 
|             dispatcher.getDynamicMatrix(null); | 
|         } | 
|         FULLY_LOADED.set(true); | 
|         return dispatcher; | 
|     } | 
|   | 
|     public static boolean isFullyLoaded() { | 
|         return FULLY_LOADED.get(); | 
|     } | 
|   | 
|   | 
| } |