File was renamed from pipIrr-platform/pipIrr-mw/pipIrr-mw-accept/src/main/java/com/dy/aceMw/Server.java |
| | |
| | | package com.dy.aceMw; |
| | | package com.dy.rtuMw; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.dy.aceMw.server.*; |
| | | import com.dy.aceMw.server.rtuData.RtuDataUnit; |
| | | import com.dy.aceMw.server.rtuData.RtuDataUnitConfigVo; |
| | | import com.dy.aceMw.server.tasks.FromRtuComResultConstantTask; |
| | | import com.dy.aceMw.server.tasks.FromRtuDataConstantTask; |
| | | import com.dy.rtuMw.server.*; |
| | | import com.dy.rtuMw.server.rtuData.RtuDataUnit; |
| | | import com.dy.rtuMw.server.rtuData.RtuDataUnitConfigVo; |
| | | import com.dy.rtuMw.server.tasks.FromRtuComResultConstantTask; |
| | | import com.dy.rtuMw.server.tasks.FromRtuDataConstantTask; |
| | | import com.dy.common.mw.UnitInterface; |
| | | import com.dy.common.mw.channel.rmi.RmiConfigVo; |
| | | import com.dy.common.mw.channel.rmi.RmiUnit; |
| | |
| | | import com.dy.common.mw.protocol.ProtocolUnit; |
| | | import com.dy.common.mw.support.SupportUnit; |
| | | import com.dy.common.mw.support.SupportUnitConfigVo; |
| | | import com.dy.aceMw.server.tasks.ToRtuConstantTask; |
| | | import com.dy.aceMw.resource.ResourceUnit; |
| | | import com.dy.aceMw.resource.ResourceUnitConfigVo; |
| | | import com.dy.rtuMw.server.tasks.ToRtuConstantTask; |
| | | 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.IDLongGenerator; |
| | | |
| | | import org.jdom2.Document; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | |
| | | |
| | | private String RmiSvUrl ; |
| | | private String TcpSvUrl ; |
| | | |
| | | @Value("${server.port}") |
| | | private String HttpSvPort ; |
| | | @Value("${server.servlet.context-path}") |
| | | private String HttpSvPath ; |
| | | |
| | | private List<UnitInterface> units = new ArrayList<UnitInterface>() ; |
| | | |
| | | /* |
| | |
| | | */ |
| | | public void startServer(){ |
| | | // try { |
| | | // URL url = Server.class.getResource("/config/sv.licence"); |
| | | // URL url = Server.class.getResource("/config/this.licence"); |
| | | // if(!new Lnp(null).parese(url.getPath())){ |
| | | // System.out.println("zhzc licence error!") ; |
| | | // return ; |
| | |
| | | // System.out.println("zhzc licence error!") ; |
| | | // return ; |
| | | // } |
| | | Server sv = new Server(); |
| | | //Server sv = new Server(); |
| | | long start = System.currentTimeMillis() ; |
| | | try { |
| | | //ConfigProperties.init(sv.getClass().getResourceAsStream("/config/config.properties"), false); |
| | | //ConfigProperties.init(this.getClass().getResourceAsStream("/config/config.properties"), false); |
| | | |
| | | sv.conf = new ConfigXml() ; |
| | | sv.doc = sv.conf.createDom(sv.getClass(), "config.xml") ; |
| | | this.conf = new ConfigXml() ; |
| | | this.doc = this.conf.createDom(this.getClass(), "config.xml") ; |
| | | //////////////// |
| | | //服务 配置 |
| | | sv.showStartInfo = sv.conf.getSetAttrBoolean(sv.doc, "config.server", "showStartInfo", null, null) ; |
| | | this.showStartInfo = this.conf.getSetAttrBoolean(this.doc, "config.server", "showStartInfo", null, null) ; |
| | | |
| | | sv.startUnits() ; |
| | | this.startUnits() ; |
| | | |
| | | String svName ; |
| | | try{ |
| | | svName = sv.conf.getSetAttrTxt(sv.doc, "config.server", "name", null, false, null) ; |
| | | svName = this.conf.getSetAttrTxt(this.doc, "config.server", "name", null, false, null) ; |
| | | }catch(Exception e){ |
| | | svName = "" ; |
| | | } |
| | |
| | | |
| | | String company ; |
| | | try{ |
| | | company = sv.conf.getSetAttrTxt(sv.doc, "config.server", "company", null, true, null) ; |
| | | company = this.conf.getSetAttrTxt(this.doc, "config.server", "company", null, true, null) ; |
| | | }catch(Exception e){ |
| | | company = "" ; |
| | | } |
| | |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@@@ &@@@@@@@@@@@@@@") ; |
| | | System.out.println("@@@@@@$ $@@@@@@@@@& O@@@@@@@@@@@#") ; |
| | | System.out.println("@@@@@@$ @@@@@@@@@ @@@@@@@@@& " + svName + "RtuMw 1.0.00" ) ; |
| | | System.out.println("@@@@@@$ @@@@@@@@@ &@@@@@@@@") ; |
| | | if(sv.TcpSvUrl != null){ |
| | | System.out.println("@@@@@@$ O@@@@@@@@@ &@@@@@@@@ TcpSv " + sv.TcpSvUrl ) ; |
| | | if(this.HttpSvPath != null && this.HttpSvPort != null){ |
| | | System.out.println("@@@@@@$ O@@@@@@@@@ &@@@@@@@@ HttpSv [ip]:" + this.HttpSvPort + this.HttpSvPath) ; |
| | | }else{ |
| | | System.out.println("@@@@@@$ O@@@@@@@@@ &@@@@@@@@") ; |
| | | } |
| | | |
| | | if(this.TcpSvUrl != null){ |
| | | System.out.println("@@@@@@$ O@@@@@@@@@ &@@@@@@@@ TcpSv " + this.TcpSvUrl ) ; |
| | | }else{ |
| | | System.out.println("@@@@@@$ O@@@@@@@@@ &@@@@@@@@") ; |
| | | } |
| | | if(sv.RmiSvUrl != null){ |
| | | System.out.println("@@@@@@$ #@@@@@@@@@$ &@@@@@@@@ RmiSv " + sv.RmiSvUrl ) ; |
| | | if(this.RmiSvUrl != null){ |
| | | System.out.println("@@@@@@$ #@@@@@@@@@$ &@@@@@@@@ RmiSv " + this.RmiSvUrl ) ; |
| | | }else{ |
| | | System.out.println("@@@@@@$ #@@@@@@@@@$ &@@@@@@@@" ) ; |
| | | } |