@Override public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { System.out.println("[TARS] init manage service"); Server.loadServerConfig(); Server.initCommunicator(); Server.configLogger(); Server.startManagerService(); } }
public void startUp(AppContext appContext) { try { // initCommunicator(); // // configLogger(); // // startManagerService(); startAppContext(appContext); startSessionManager(); registerServerHook(); System.out.println("[SERVER] server is ready..."); } catch (Throwable ex) { System.out.println("[SERVER] failed to start server..."); ex.printStackTrace(); System.out.close(); System.err.close(); System.exit(-1); } }
public static void main(String[] args) throws Exception { Server.loadServerConfig(); Server.initCommunicator(); Server.configLogger(); Server.startManagerService(); AppContext context = null; URL servantXML = Main.class.getClassLoader().getResource("servants.xml"); if (servantXML != null) { context = new XmlAppContext(); } else if (Main.class.getClassLoader().getResource("servants-spring.xml") != null){ System.out.println("[SERVER] find servants-spring.xml, use Spring mode."); Class clazz = Class.forName("com.qq.tars.server.apps.SpringAppContext"); context = (AppContext) clazz.newInstance(); } else { System.out.println("[SERVER] servants profile does not exist, start failed."); throw new TarsException("servants profile does not exist"); } new Server(ConfigurationManager.getInstance().getServerConfig()).startUp(context); } }
@Override public void start() { try { server.startUp(new SpringBootAppContext(applicationContext)); isRunning = true; } catch (Exception e) { e.printStackTrace(); isRunning = false; } }
@Bean public Server server() { return new Server(ConfigurationManager.getInstance().getServerConfig()); }
public static void main(String[] args) throws Exception { Server.loadServerConfig(); Server.initCommunicator(); Server.configLogger(); Server.startManagerService(); AppContext context = null; URL servantXML = Main.class.getClassLoader().getResource("servants.xml"); if (servantXML != null) { context = new XmlAppContext(); } else if (Main.class.getClassLoader().getResource("servants-spring.xml") != null){ System.out.println("[SERVER] find servants-spring.xml, use Spring mode."); Class clazz = Class.forName("com.qq.tars.server.apps.SpringAppContext"); context = (AppContext) clazz.newInstance(); } else { System.out.println("[SERVER] servants profile does not exist, start failed."); throw new TarsException("servants profile does not exist"); } new Server(ConfigurationManager.getInstance().getServerConfig()).startUp(context); } }
public void startUp(AppContext appContext) { try { // initCommunicator(); // // configLogger(); // // startManagerService(); startAppContext(appContext); startSessionManager(); registerServerHook(); System.out.println("[SERVER] server is ready..."); } catch (Throwable ex) { System.out.println("[SERVER] failed to start server..."); ex.printStackTrace(); System.out.close(); System.err.close(); System.exit(-1); } }