//--------------------------------------------------- // // Agent Initialization // //--------------------------------------------------- void Init(SmtpAgentSettings settings) { if (settings.FailedInit) { EventLogHelper.WriteError( new LogFileSettings().EventLogSource, "Failed Init! Using a disabled SmtpAgentSettings."); m_settings = settings; var log = new NLogFactory(settings.LogSettings); m_logger = log.GetLogger(GetType()); return; } m_settings = settings; m_settings.Validate(); m_auditor = IoC.ResolveAll <IAuditor <IBuildAuditLogMessage> >().ToList(); m_logger = Log.For(this); m_diagnostics = new AgentDiagnostics(this); m_configService = new ConfigService(m_settings); m_monitorService = new MonitorService(m_settings); using (new MethodTracer(Logger)) { try { // // First, setup defaults using Xml Config // this.InitDomains(); this.InitFolders(); this.InitRoutes(); this.InitNotifications(); // // Call config service, if any was configured // this.InitDomainsFromConfigService(); // // Finally, we can agent... // this.InitAgent(); this.SubscribeToAgentEvents(); this.ConfigureServicePoints(); } catch (Exception ex) { Logger.Error("While initializing {0}", ex.ToString()); throw; } } }
//--------------------------------------------------- // // Agent Initialization // //--------------------------------------------------- void Init(SmtpAgentSettings settings) { m_settings = settings; m_settings.Validate(); m_auditor = IoC.ResolveAll <IAuditor <IBuildAuditLogMessage> >().ToList(); m_logger = Log.For(this); m_diagnostics = new AgentDiagnostics(this); m_configService = new ConfigService(m_settings); m_monitorService = new MonitorService(m_settings); using (new MethodTracer(Logger)) { try { // // First, setup defaults using Xml Config // this.InitDomains(); this.InitFolders(); this.InitRoutes(); this.InitNotifications(); // // Call config service, if any was configured // this.InitDomainsFromConfigService(); // // Finally, we can agent... // this.InitAgent(); this.SubscribeToAgentEvents(); this.ConfigureServicePoints(); } catch (Exception ex) { Logger.Error("While initializing {0}", ex.ToString()); throw; } } }
//--------------------------------------------------- // // Agent Initialization // //--------------------------------------------------- void Init(SmtpAgentSettings settings) { m_settings = settings; m_settings.Validate(); m_auditor = IoC.ResolveAll<IAuditor<IBuildAuditLogMessage>>().ToList(); m_logger = Log.For(this); m_diagnostics = new AgentDiagnostics(this); m_configService = new ConfigService(m_settings); m_monitorService = new MonitorService(m_settings); using (new MethodTracer(Logger)) { try { // // First, setup defaults using Xml Config // this.InitDomains(); this.InitFolders(); this.InitRoutes(); this.InitNotifications(); // // Call config service, if any was configured // this.InitDomainsFromConfigService(); // // Finally, we can agent... // this.InitAgent(); this.SubscribeToAgentEvents(); this.ConfigureServicePoints(); } catch (Exception ex) { Logger.Error("While initializing {0}", ex.ToString()); throw; } } }