Package br.com.procempa.modus.entity

Examples of br.com.procempa.modus.entity.ExceptionLog


        } catch (BusinessException ex) {
          MessageView.showWarning(ex.getMessage(),
              "Falha ao remover equipamento.");
        } catch (Exception e1) {
          // TODO Implementar controle de exce��es
          ExceptionLog log = ExceptionLogService.log(e1,
              "Falha ao remover equipamento.");
          ErrorView.show(log);
          e1.printStackTrace();
        }
        ((EquipamentoTableModel) table.getModel()).removeItem(eq);
View Full Code Here


  public static ExceptionLog log(ExceptionLog exception) {
    return logger.log(exception);
  }

  public static ExceptionLog log(Exception e, String contextMessage, String user, String telecentro) {
    ExceptionLog eLog = new ExceptionLog();
           
    eLog.setContextMessage(contextMessage);
    eLog.setException(e.getClass().getName());
    eLog.setMessage(e.getMessage());

    StringBuffer buffer = new StringBuffer();
    int length = e.getStackTrace().length;
    for (int i = 0; i < length; i++) {
      buffer.append(e.getStackTrace()[i].getClassName() + STACK_DELIMITER);
      buffer.append(e.getStackTrace()[i].getMethodName() + STACK_DELIMITER);
     
      String tmpFileName = e.getStackTrace()[i].getFileName();
      buffer.append( (tmpFileName == null ? "" : tmpFileName) + STACK_DELIMITER);

      int tmpLineNumber = e.getStackTrace()[i].getLineNumber();
      buffer.append(tmpLineNumber < 1 ? "" : tmpLineNumber);
     
      buffer.append(i < length ? "\n" : "");
    }
   
    eLog.setStackTrace(buffer.toString());

    eLog.setUser(user);
    eLog.setTelecentro(telecentro);
   
    return log(eLog);
  }
View Full Code Here

        .search(
            "FROM ExceptionLog WHERE timestamp >= :dataInicio AND timestamp <= :dataFim",
            params);

    for (Persistent persistent : list) {
      ExceptionLog excecao = (ExceptionLog) persistent;
      RelatorioExcecaoVO excecaoVO = new RelatorioExcecaoVO();
      excecaoVO.setUsuario(excecao.getUser());
      excecaoVO.setTelecentro(excecao.getTelecentro());
      excecaoVO.setExcecao(excecao.getException());
      excecaoVO.setData(excecao.getTimestamp().getTime());
      excecaoVO.setMensagem(excecao.getMessage());
      excecoes.add(excecaoVO);
    }
    return excecoes;
  }
View Full Code Here

          Main.getInstance().buildPanel(UsuarioSearch.getInstance());

        } catch (ValidationException ex) {
          ValidationView.show(ex.getValidationList());
        } catch (PersistException ex) {
          ExceptionLog eLog = ExceptionLogService
              .log(ex, "Erro ao salvar a Visita", UserContext
                  .getInstance().getUsuario().getNome(),
                  UserContext.getInstance().getTelecentro()
                      .getNome());
          ErrorView.show(eLog);
View Full Code Here

      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException e) {
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na obten��o do PersistentAccess.");
      throw new PersistException(log);
      // TODO Trocar Exception por PersistException quando for resolvido o
      // problema
      // da serializa��o de arrays no ejb 3
    } catch (Exception e) {
      if (e instanceof ValidationException) {
        throw (ValidationException) e;
      }

      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na persist�ncia da Visita.");
      throw new PersistException(log);
    }

    return visita;
View Full Code Here

      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException ne) {
      ne.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(ne,
          "Falha na obten��o do PersistentAccess.");
      throw new PersistException(log);
    } catch (SearchException se) {
      se.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(se,
          "Falha na busca de usu�rio");
      throw new PersistException(log);
    } catch (Exception e) {
      if (e instanceof ValidationException) {
        throw (ValidationException) e;
      }
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na persist�ncia de Usu�rio.");
      throw new PersistException(log);
    }

    return usuario;
View Full Code Here

      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException e) {
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na obten��o do PersistentAccess.");
      throw new PersistException(log);
      // TODO Trocar Exception por PersistException quando for resolvido o
      // problema
      // da serializa��o de arrays no ejb 3
    } catch (Exception e) {
      if (e instanceof ValidationException) {
        throw (ValidationException) e;
      }
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na persist�ncia de Curso.");
      throw new PersistException(log);
    }
    return curso;
  }
View Full Code Here

      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException e) {
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na obten��o do PersistentAccess.");
      throw new PersistException(log);
      // TODO Trocar Exception por PersistException quando for resolvido o
      // problema
      // da serializa��o de arrays no ejb 3
    } catch (Exception e) {
      if (e instanceof ValidationException) {
        throw (ValidationException) e;
      }

      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na persist�ncia do Equipamento.");
      throw new PersistException(log);
    }

    return equipamento;
View Full Code Here

      } else {
        throw new ValidationException(validationList);
      }
    } catch (NamingException e) {
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na obten��o do PersistentAccess.");
      throw new PersistException(log);
      // TODO Trocar Exception por PersistException quando for resolvido o
      // problema
      // da serializa��o de arrays no ejb 3
    } catch (Exception e) {
      if (e instanceof ValidationException) {
        throw (ValidationException) e;
      }
      e.printStackTrace();
      ExceptionLog log = ExceptionLogService.log(e,
          "Falha na persist�ncia de Turma.");
      throw new PersistException(log);
    }

    return turma;
View Full Code Here

  public static ExceptionLog log(ExceptionLog exception) {
    return logger.log(exception);
  }

  public static ExceptionLog log(Exception e, String contextMessage, String user, String telecentro) {
    ExceptionLog eLog = new ExceptionLog();
           
    eLog.setContextMessage(contextMessage);
    eLog.setException(e.getClass().getName());
    eLog.setMessage(e.getMessage());
    eLog.setUser(UserContext.getInstance().getUsuario());

    StringBuffer buffer = new StringBuffer();
    int length = e.getStackTrace().length;
    for (int i = 0; i < length; i++) {
      buffer.append(e.getStackTrace()[i].getClassName() + STACK_DELIMITER);
      buffer.append(e.getStackTrace()[i].getMethodName() + STACK_DELIMITER);
     
      String tmpFileName = e.getStackTrace()[i].getFileName();
      buffer.append( (tmpFileName == null ? "" : tmpFileName) + STACK_DELIMITER);

      int tmpLineNumber = e.getStackTrace()[i].getLineNumber();
      buffer.append(tmpLineNumber < 1 ? "" : tmpLineNumber);
     
      buffer.append(i < length ? "\n" : "");
    }
   
    eLog.setStackTrace(buffer.toString());

    eLog.setUserName(user);
    eLog.setTelecentro(telecentro);
   
    return log(eLog);
  }
View Full Code Here

TOP

Related Classes of br.com.procempa.modus.entity.ExceptionLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.