Esempio n. 1
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!");
            }
        }
Esempio n. 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.InfoFormat("The server instance {0} has failed to be started!", server.Name);
                    }
                }
                else
                {
                    succeeded++;

                    if (Config.Isolation != IsolationMode.None)
                    {
                        if (m_GlobalLog.IsInfoEnabled)
                        {
                            m_GlobalLog.InfoFormat("The server instance {0} has been started!", server.Name);
                        }
                    }
                }
            }

            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);
        }