Health.Direct.SmtpAgent.SmtpAgent EnsureAgent(string configFilePath) { lock (s_agentsSync) { Health.Direct.SmtpAgent.SmtpAgent agent = null; if (!s_agents.TryGetValue(configFilePath, out agent)) { try { agent = SmtpAgentFactory.Create(configFilePath); s_agents[configFilePath] = agent; } catch (Exception ex) { Logger.Fatal("While EnsuringAgent with path - " + configFilePath, ex); throw; } } return(agent); } }
public void InitFromConfigFile(string configFilePath) { Health.Direct.SmtpAgent.SmtpAgent agent = this.EnsureAgent(configFilePath); System.Threading.Interlocked.Exchange <Health.Direct.SmtpAgent.SmtpAgent>(ref m_agent, agent); }