@Override public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { System.out.println("[TARS] init manage service"); Server.loadServerConfig(); Server.initCommunicator(); Server.configLogger(); Server.startManagerService(); } }
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 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); } }