| | |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.thread.impl.*; |
| | | |
| | |
| | | @Async |
| | | public void init() throws InterruptedException { |
| | | News.info("核心控制层开始初始化..............................................."); |
| | | clearStartupRuntimeLocks(); |
| | | // 初始化消息队列 |
| | | initMq(); |
| | | // 初始化下位机线程 |
| | |
| | | // 开始主流程进程 |
| | | mainProcess.start(); |
| | | News.info("核心控制层已启动..............................................."); |
| | | } |
| | | |
| | | private void clearStartupRuntimeLocks() { |
| | | redisUtil.del(RedisKeyType.STATION_EXECUTE_COMMAND_LOCK.key); |
| | | // News.info("系统启动时已清理输送站命令执行锁,key={}", RedisKeyType.STATION_EXECUTE_COMMAND_LOCK.key); |
| | | } |
| | | |
| | | private void initMq(){ |
| | |
| | | thread = new ZyStationV3Thread(deviceConfig, redisUtil); |
| | | } else if (deviceConfig.getThreadImpl().equals("ZyStationV4Thread")) { |
| | | thread = new ZyStationV4Thread(deviceConfig, redisUtil); |
| | | } else if (deviceConfig.getThreadImpl().equals("ZyStationV5Thread")) { |
| | | thread = new ZyStationV5Thread(deviceConfig, redisUtil); |
| | | } else { |
| | | throw new CoolException("未知的线程实现"); |
| | | } |