public static void Initialize() { LoadConfig(); if (!startServer) return; if (logger != null) logger.Close(); logger = new Logger.Logger(logDir , typeof(GFXDServerMgr).FullName + ".log"); locator = new GFXDLocator(); locator.Start(); try { for (int i = 0; i < numServers; i++) { GFXDServer server = new GFXDServer(locator); server.Start(); AddServer(server); } } catch (Exception e) { Log(DbHelper.GetExceptionDetails(e, new StringBuilder()).ToString()); } }
public static GFXDServer GetServer(String serverName) { GFXDServer server = null; String error = string.Empty; if (GFXDServers.ContainsKey(serverName)) { try { server = GFXDServers[serverName]; if (server == null) { error = String.Format("Server {0} is null", serverName); Log(error); throw new Exception(error); } } catch (Exception e) { error = String.Format( "Encounter exception in GetServer() for {0}. {1}", serverName, e.Message); Log(error); throw new Exception(error); } } else { error = String.Format("Server {0} does not exist", serverName); Log(error); throw new Exception(error); } return(server); }
public static void Initialize() { LoadConfig(); if (!startServer) { return; } if (logger != null) { logger.Close(); } logger = new Logger.Logger(logDir, typeof(GFXDServerMgr).FullName + ".log"); locator = new GFXDLocator(); locator.Start(); try { for (int i = 0; i < numServers; i++) { GFXDServer server = new GFXDServer(locator); server.Start(); AddServer(server); } } catch (Exception e) { Log(DbHelper.GetExceptionDetails(e, new StringBuilder()).ToString()); } }
public static void StopServer(String serverName, bool removeDir) { GFXDServer server = GetServer(serverName); if (server.ServerState == GFXDState.STARTED) { server.Stop(removeDir); } }
public static void StartServer(String serverName) { GFXDServer server = GetServer(serverName); if (server.ServerState == GFXDState.STOPPED) { server.Start(); } }
public static void AddServer(GFXDServer server) { GFXDServers.Add(server.ServerName, server); }