Exemple #1
0
        public String Acessa_UDDI()
        {
            cls_InteraceMensagem.Log(Resources.ResourceManager.GetString("ACESSANDO_UDDI"));
            String maquina = cls_Agente.Servidores.cls_UDDI.ObtemProximaURL();

            cls_InteraceMensagem.Log(String.Format(Resources.ResourceManager.GetString("SERVIDOR_ENCONTRADO"), maquina));
            cls_InteraceMensagem.Envia(String.Format(Resources.ResourceManager.GetString("ENVIANDO_URL_ALTERNATIVA"), maquina));
            return(maquina);
        }
 private void FormMonitorRecurso_Load(object sender, EventArgs e)
 {
     try
     {
         if (!E_Admin())
         {
             cls_InterfaceMensagem.Log(Resources.ResourceManager.GetString("EXECUTE_COMO_ADMIN"));
         }
         else
         {
             try
             {
                 // Inicia WCF auto-contido.
                 GerenciadorRecurso = new ServiceHost(typeof(Service_Gerenciador_Recurso));
                 GerenciadorRecurso.Open();
                 cls_InterfaceMensagem.Log(Resources.ResourceManager.GetString("SERVICO_GERENCIADOR_RECURSO_INICIADO"));
             }
             catch (Exception ex)
             {
                 cls_InterfaceMensagem.Log(ex.Message);
             }
         }
     }
     catch (Exception ex)
     {
         cls_InterfaceMensagem.Log(ex.Message);
     }
 }
        /// <summary>
        /// Inicializa formulário
        /// Carrega UDDI do Arquivo XML
        /// Inicializa Interface de Solicitação de Ajuda
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form_AgenteAutonomo_Load(object sender, EventArgs e)
        {
            if (!E_Admin())
            {
                cls_InteraceMensagem.Log(Resources.ResourceManager.GetString("EXECUTE_COMO_ADMIN"));
            }
            else
            {
                cls_AgenteAtuador = new Class_Atuador(cls_InteraceMensagem, this);

                cls_AgenteSensor            = new Class_Sensor();
                cls_Agente                  = new Class_Agente(cls_UDDI, cls_AgenteAtuador, cls_AgenteSensor);
                cls_ControleUDDI            = new Class_ControleUDDI(cls_UDDI, listBoxUDDI);
                textBox_NomeComputador.Text = listBoxUDDI.Items[0].ToString();

                InicializaInterface_ServiceSolicitacaoAjuda();
                InicializaInterface_ServiceResposta();
            }
        }
Exemple #4
0
        /// <summary>
        /// Chama o Agente autônomo em caso de erro
        /// </summary>
        private void ChamaAgenteAutonomo()
        {
            String servico    = textBox_NomeServico.Text;
            String computador = textBox_NomeComputador.Text;

            // Chama assincronomente
            cls_InterfaceMensagem.Log(String.Format(Resources.ResourceManager.GetString("SOLICITACAO_REINICIO"), servico, computador));
            Exception exService = cls_Mensagens.ChamaAgenteAutonomo(computador, servico);

            if (exService != null)
            {
                cls_InterfaceMensagem.Recebe(String.Format(Resources.ResourceManager.GetString("ERRO_HRESULT"), String.Format("#{0:X}", exService.HResult), exService.Message));
            }
        }