| | |
| | | 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.channel.tcp.TcpConfigVo; |
| | | import com.dy.common.mw.channel.tcp.TcpUnit; |
| | | import com.dy.common.mw.core.CoreUnit; |
| | |
| | | new Server().startServer(); |
| | | } |
| | | */ |
| | | |
| | | public void startServer(){ |
| | | /** |
| | | try { |
| | | URL url = Server.class.getResource("/config/this.licence"); |
| | | if(!new Lnp(null).parese(url.getPath())){ |
| | | System.out.println("licence error!") ; |
| | | return ; |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("licence error!") ; |
| | | return ; |
| | | } |
| | | */ |
| | | if(this.doStartServer()){ |
| | | ServerShutDownHook.OnShutDown(); |
| | | } |
| | | } |
| | | /** |
| | | * 启动服务 |
| | | */ |
| | | public void startServer(){ |
| | | // try { |
| | | // URL url = Server.class.getResource("/config/this.licence"); |
| | | // if(!new Lnp(null).parese(url.getPath())){ |
| | | // System.out.println("licence error!") ; |
| | | // return ; |
| | | // } |
| | | // } catch (Exception e) { |
| | | // System.out.println("licence error!") ; |
| | | // return ; |
| | | // } |
| | | //Server sv = new Server(); |
| | | private boolean doStartServer(){ |
| | | boolean running = false ; |
| | | long start = System.currentTimeMillis() ; |
| | | try { |
| | | //ConfigProperties.init(this.getClass().getResourceAsStream("/config/config.properties"), false); |
| | |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@@# &@@@@@@@@ Runing in standalone mode" ) ; |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@@@& &@@@@@@@@ Startup in " + (System.currentTimeMillis() - start) + " MS" ) ; |
| | | System.out.println("@@@@@@@@@@@@@@@@@@@# &@@@@@@@@ " + company) ; |
| | | System.out.println("@@@@@@@@@@@@@@@@#O &@@@@@@@@") ; |
| | | |
| | | System.out.println("@@@@@@@@@@@@@@@@#O &@@@@@@@@") ; |
| | | running = true ; |
| | | }catch(Exception e){ |
| | | e.printStackTrace(); |
| | | running = false ; |
| | | } |
| | | return running ; |
| | | } |
| | | |
| | | private void startUnits(){ |