コード例 #1
0
        public static void SetupAppProcesses(string serverConfigFile)
        {
            if (string.IsNullOrWhiteSpace(serverConfigFile))
                throw new ArgumentNullException(serverConfigFile);

            serverConfigFilePath = serverConfigFile;

            // Load Controller Configuration 
            currentAppServerConfiguration = ProcessConfigurationManager.GetConfiguration(serverConfigFile);
            if (currentAppServerConfiguration == null)
                throw new ConfigurationErrorsException(serverConfigFile);

            var watch = ProcessConfigurationManager.EnableRaisingFileWatcherEvent;
            var monitor = currentAppServerConfiguration.MonitorProcess();
            var interval = currentAppServerConfiguration.MonitorTimeInterval();

            SetUpController(watch, monitor, interval);

            appAppProcesses = SetupAppProcesses(currentAppServerConfiguration);
        }
コード例 #2
0
        private static void HandleAppServerConfigurationUpdate(ProcessControlConfiguration updatedConfig)
        {
            lock (eventLocker)
            {
                logger.DebugFormat("Received the updated ProcessControlConfiguration from the file change event. {0}", updatedConfig.SerializeToString());

                if ((monitorTimerTask != null) && (monitoring))
                {
                    monitorTimerTask.StopTimer();
                }

                var watch = ProcessConfigurationManager.EnableRaisingFileWatcherEvent;
                var monitor = updatedConfig.MonitorProcess();
                var interval = updatedConfig.MonitorTimeInterval();

                SetUpController(watch, monitor, interval);

                ManageAppServers(updatedConfig);

                if ((monitorTimerTask != null) && (monitoring))
                {
                    monitorTimerTask.StartTimer(interval);
                }
            }
        }