Code example for CronTrigger

0
      return false; 
    } 
    alreadyScheduledProjects.add(project);
 
    QualityAnalyzerService qualityAnalyzerService = createDefaultQualityAnalyzer();
    scheduler.schedule(new AnalyzerRunnable(project, projectRepository, qualityAnalyzerService), new CronTrigger(project.getCronExpression()));
    log.info("Scheduled analyzer job for project {} with cron expression {}", project.getName(), project.getCronExpression());
    return true; 
  } 
 
  private DefaultQualityAnalyzerService createDefaultQualityAnalyzer() { 
    return new DefaultQualityAnalyzerService(violationsCalculatorService,
        scmAvailabilityCheckerServiceFactory,
        codeChangeProbabilityCalculatorFactory,
        secureChangeProbabilityCalculator,
        costsCalculator,
        qualityAnalysisRepository);
  } 
}