コード例 #1
0
        private void loadEndPoints()
        {
            List<string> endPoints = XMLUtils.DeSerilize<List<string>>(m_EndPointsFilePath);
            IRestartService restartService = null;
            AgentInstance agentInstance = null;
            Stopwatch sw = new Stopwatch();
            sw.Start();
            string fullEndPoint = string.Empty;
            LogManager.Instance.WriteInfo("CreateChannel operation on endpoints started");
            foreach (string endpoint in endPoints)
            {
                try
                {
                    fullEndPoint = "http://" + endpoint + ":5050/RestartService";
                    restartService = WCFUtils.ServiceFactory<IRestartService>.GetService(fullEndPoint);
                    agentInstance = new AgentInstance(restartService);
                    agentInstance.UpdateInstanceInfo();
                    m_Agents.Add(agentInstance.IP, agentInstance);
                    LogManager.Instance.WriteInfo("[Endpoint]: " + fullEndPoint + " Added");

                }
                catch (Exception ex)
                {
                    SystemLogManager.Instance.Log(eLogType.Error, "TryingCreateChannel", fullEndPoint, string.Empty, ex.Message, string.Empty);
                    LogManager.Instance.WriteError("Error while trying to CreateChannel , [Endpoint]: " + fullEndPoint + " [Exception]: " + ex.Message);
                }
            }
            sw.Stop();
            LogManager.Instance.WriteInfo("CreateChannel operation on endpoints ended, elapsed: " + sw.Elapsed);
        }
コード例 #2
0
 public void Log(eLogType i_LogType, AgentInstance i_AgentInstance, string i_Info,string i_Elapsed)
 {
     string machineName = i_AgentInstance.ComputerName;
     string IP = i_AgentInstance.IP;
     Log(i_LogType, machineName, IP, string.Empty, i_Info, i_Elapsed);
 }