/*
  * (non-Javadoc)
  *
  * @see org.quartz.JobListener#jobWasExecuted(org.quartz.JobExecutionContext, org.quartz.JobExecutionException)
  */
 @Override
 public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {
   String jobName = context.getJobDetail().getKey().getName();
   final BatchSchedule sch = batchSerivce.findSchById(jobName);
   final JobExecution job = (JobExecution) context.get(CapBatchConstants.K_JobExecution);
   if (sch != null && job != null) {
     if (sch.isNotify()
         && !CapString.isEmpty(sch.getNotifyStatus())
         && !CapString.isEmpty(sch.getNotifyTo())) {
       for (String status : sch.getNotifyStatus().split(",")) {
         if (CapString.trimNull(status).equals(job.getExitStatus().getExitCode())) {
           // 主旨
           String subject =
               MessageFormat.format(
                   mailSubject,
                   new Object[] {
                     sch.getSchId(), sch.getSchDesc(), job.getExitStatus().getExitCode()
                   });
           mailSender.sendEmail(sch.getNotifyTo().split(","), subject, buildText(job));
           break;
         }
       }
     }
   }
 }
 /*
  * (non-Javadoc)
  *
  * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
  */
 @Override
 public void afterPropertiesSet() throws Exception {
   Set<String> l = new HashSet<String>();
   String i18nPattern = basePath + "/**/*.properties";
   String i18nFileREG = "(" + StringUtils.join(languages, '|') + ").properties$";
   if (defaultLocale != null) {
     Locale.setDefault(this.defaultLocale);
   }
   try {
     Resource[] resources = applicationContext.getResources(i18nPattern);
     for (Resource resource : resources) {
       String path = resource.getURI().toString();
       if (CapString.checkRegularMatch(path, i18nFileREG)) {
         path =
             path.replaceAll(i18nFileREG, "")
                 .replaceAll(".*/i18n/", "classpath:/i18n/")
                 // for windows
                 .replaceAll(".*\\\\i18n\\\\", "classpath:\\\\i18n\\\\")
                 .replaceAll("\\\\", "/");
         if (!l.contains(path)) {
           l.add(path);
           logger.debug("set message path:" + path);
         }
       }
     }
   } catch (Exception e) {
     logger.error(e.getMessage(), e);
   }
   super.setBasenames(l.toArray(new String[l.size()]));
 }
Beispiel #3
0
 @Override
 public void merge(List<DivFtDtl> divFtDtls) {
   for (DivFtDtl ftDtl : divFtDtls) {
     if (!CapString.isEmpty(ftDtl.getOid())) merge(ftDtl);
   }
 }