Exemplo n.º 1
0
  @Asynchronous
  public void checkImmediately(BatchIntervalInfo info) {

    try {
      List<ProjectInformation> pi =
          projectInformationService.getProjectInformation(info.getUsername(), info.getPassword());
      for (ProjectInformation projectInformation : pi) {
        markCritialTasks(projectInformation, info);
        if (!info.isReportFull()) {
          filterOutNotCriticalTasks(projectInformation, info);
        }
        if (projectInformation.getTasks().size() > 0) {
          send(projectInformation);
        }
      }

    } catch (Exception ex) {
      Logger.getLogger(BatchTimerBean.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
Exemplo n.º 2
0
  @Timeout
  public void check(Timer timer) {
    BatchIntervalInfo bi = (BatchIntervalInfo) timer.getInfo();
    try {
      List<ProjectInformation> pi =
          projectInformationService.getProjectInformation(bi.getUsername(), bi.getPassword());
      for (ProjectInformation projectInformation : pi) {
        markCritialTasks(projectInformation, bi);
        if (!bi.isReportFull()) {
          filterOutSendedWarnings(projectInformation, bi);
          filterOutNotCriticalTasks(projectInformation, bi);
        }
        if (projectInformation.getTasks().size() > 0) {
          send(projectInformation);
          markTasksAsSended(projectInformation);
        }
      }

    } catch (Exception ex) {
      Logger.getLogger(BatchTimerBean.class.getName()).log(Level.SEVERE, null, ex);
    }
  }