Start() public méthode

public Start ( ) : void
Résultat void
        /// <summary>
        /// Starts this bootstrap.
        /// </summary>
        /// <returns></returns>
        public StartResult Start()
        {
            if (!m_Initialized)
            {
                if (m_GlobalLog.IsErrorEnabled)
                {
                    m_GlobalLog.Error("You cannot invoke method Start() before initializing!");
                }

                return(StartResult.Failed);
            }

            var result = StartResult.None;

            var succeeded = 0;

            foreach (var server in m_AppServers)
            {
                if (!server.Start())
                {
                    if (m_GlobalLog.IsErrorEnabled)
                    {
                        m_GlobalLog.InfoFormat("The server instance {0} has failed to be started!", server.Name);
                    }
                }
                else
                {
                    succeeded++;
                }
            }

            if (m_AppServers.Any())
            {
                if (m_AppServers.Count == succeeded)
                {
                    result = StartResult.Success;
                }
                else if (succeeded == 0)
                {
                    result = StartResult.Failed;
                }
                else
                {
                    result = StartResult.PartialSuccess;
                }
            }

            if (m_PerfMonitor != null)
            {
                m_PerfMonitor.Start();

                if (m_GlobalLog.IsDebugEnabled)
                {
                    m_GlobalLog.Debug("The PerformanceMonitor has been started!");
                }
            }

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// Starts this bootstrap.
        /// </summary>
        /// <returns></returns>
        public StartResult Start()
        {
            if (!m_Initialized)
            {
                if (m_GlobalLog.IsErrorEnabled)
                {
                    m_GlobalLog.Error("You cannot invoke method Start() before initializing!");
                }

                return(StartResult.Failed);
            }

            var result = StartResult.None;

            var succeeded = 0;

            foreach (var server in m_AppServers)
            {
                if (!server.Start())
                {
                    if (m_GlobalLog.IsErrorEnabled)
                    {
                        m_GlobalLog.Error("Failed to start " + server.Name + " server!");
                    }
                }
                else
                {
                    succeeded++;
                    if (m_GlobalLog.IsErrorEnabled)
                    {
                        m_GlobalLog.Info(server.Name + " has been started");
                    }
                }
            }

            if (m_AppServers.Any())
            {
                if (m_AppServers.Count == succeeded)
                {
                    result = StartResult.Success;
                }
                else if (m_AppServers.Count == 0)
                {
                    result = StartResult.Failed;
                }
                else
                {
                    result = StartResult.PartialSuccess;
                }
            }

            if (m_PerfMonitor != null)
            {
                m_PerfMonitor.Start();
            }

            return(result);
        }
        private void ResetPerfMoniter()
        {
            if (m_PerfMonitor != null)
            {
                m_PerfMonitor.Stop();
                m_PerfMonitor.Dispose();
                m_PerfMonitor = null;
            }

            m_PerfMonitor = new PerformanceMonitor(m_Config, m_AppServers, m_ServerManager, LogFactory);
            m_PerfMonitor.Start();

            if (m_GlobalLog.IsDebugEnabled)
            {
                m_GlobalLog.Debug("The PerformanceMonitor has been reset for new server has been added!");
            }
        }
Exemple #4
0
        private void ResetPerfMoniter()
        {
            if (m_PerfMonitor != null)
            {
                m_PerfMonitor.Stop();
                m_PerfMonitor.Dispose();
                m_PerfMonitor = null;
            }

            m_PerfMonitor = new PerformanceMonitor(m_Config, m_AppServers, m_ServerManager, LogFactory);
            m_PerfMonitor.Start();

            if (m_GlobalLog.IsDebugEnabled)
                m_GlobalLog.Debug("The PerformanceMonitor has been reset for new server has been added!");
        }