public RTScanner(String runId, List<SerializerEngine> engines) { this.engines = engines; this.blackListedRepository = new ArrayList<>(); this.whiteListedRepository = new ArrayList<>(); this.tempBlackList = new HashMap<>(); this.buildRunner = new BuildRunner(this); this.inspectBuilds = new InspectBuilds(this); this.inspectJobs = new InspectJobs(this); this.runId = runId; this.blacklistedSerializer = new BlacklistedSerializer(this.engines, this); }
@Override public void run() { Instant endOfProcessDate = new Date().toInstant().plus(duration); LOGGER.info("The process will finish at: " + endOfProcessDate); while (!new Date().toInstant().isAfter(endOfProcessDate)) { try { Thread.sleep(SLEEP_TIME * 1000); } catch (InterruptedException e) { LOGGER.warn("Sleep interrupted: premature stop will occured."); } } LOGGER.info("The process will now stop."); this.inspectBuilds.switchOff(); this.inspectJobs.switchOff(); this.buildRunner.switchOff(); if (this.endProcessNotifier != null) { this.endProcessNotifier.notifyEnd(); } } }