Пример #1
0
        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());
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
        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());
            }
        }
Пример #4
0
        public static void StopServer(String serverName, bool removeDir)
        {
            GFXDServer server = GetServer(serverName);

            if (server.ServerState == GFXDState.STARTED)
            {
                server.Stop(removeDir);
            }
        }
Пример #5
0
        public static void StartServer(String serverName)
        {
            GFXDServer server = GetServer(serverName);

            if (server.ServerState == GFXDState.STOPPED)
            {
                server.Start();
            }
        }
Пример #6
0
 public static void AddServer(GFXDServer server)
 {
     GFXDServers.Add(server.ServerName, server);
 }
Пример #7
0
 public static void AddServer(GFXDServer server)
 {
     GFXDServers.Add(server.ServerName, server);
 }