| | |
| | | import com.dy.rtuMw.resource.ResourceUnit; |
| | | import com.dy.rtuMw.resource.ResourceUnitConfigVo; |
| | | import com.dy.common.springUtil.SpringContextUtil; |
| | | import com.dy.common.util.ConfigXml; |
| | | import com.dy.common.util.ConfigXml4Springboot; |
| | | import com.dy.common.util.IDLongGenerator; |
| | | |
| | | import org.jdom2.Document; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ResourceLoader; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class Server { |
| | | |
| | | private ConfigXml conf = null ; |
| | | private ConfigXml4Springboot conf = null ; |
| | | private Document doc = null ; |
| | | private boolean showStartInfo = false ; |
| | | |
| | |
| | | private String HttpSvPort ; |
| | | @Value("${server.servlet.context-path}") |
| | | private String HttpSvPath ; |
| | | |
| | | @Autowired |
| | | protected ResourceLoader resourceLoader ; |
| | | |
| | | private List<UnitInterface> units = new ArrayList<UnitInterface>() ; |
| | | |
| | |
| | | try { |
| | | //ConfigProperties.init(this.getClass().getResourceAsStream("/config/config.properties"), false); |
| | | |
| | | this.conf = new ConfigXml() ; |
| | | this.doc = this.conf.createDom(this.getClass(), "config.xml") ; |
| | | this.conf = new ConfigXml4Springboot() ; |
| | | this.doc = this.conf.createDom(this.resourceLoader, "config.xml") ; |
| | | //////////////// |
| | | //服务 配置 |
| | | this.showStartInfo = this.conf.getSetAttrBoolean(this.doc, "config.server", "showStartInfo", null, null) ; |
| | |
| | | ///////////////// |
| | | //RTU上行数据处理模块 |
| | | RtuDataUnitConfigVo rducVo = new RtuDataUnitConfigVo(); |
| | | rducVo.resourceLoader = this.resourceLoader ; |
| | | AdapterImp_RtuDataUnit rducAdap = new AdapterImp_RtuDataUnit(); |
| | | rducAdap.setConfig(rducVo); |
| | | RtuDataUnit rducUnit = RtuDataUnit.getInstance(); |