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