protected void registerJobListener() throws SchedulerException { KSBServiceLocator.getScheduler().addGlobalJobListener(new JobListenerSupport() { @Override public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) { log.info("Job was executed: " + context); if (MessageProcessingJob.NAME.equals(context.getJobDetail().getName())) { signal.countDown(); } } public String getName() { return System.currentTimeMillis() + RandomStringUtils.randomAlphanumeric(10); } }); }
protected void registerJobListener() throws SchedulerException { KSBServiceLocator.getScheduler().getListenerManager().addJobListener(new JobListenerSupport() { @Override public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) { log.info("Job was executed: " + context); if (MessageProcessingJob.NAME.equals(((JobDetailImpl) context.getJobDetail()).getName())) { signal.countDown(); } } public String getName() { return System.currentTimeMillis() + RandomStringUtils.randomAlphanumeric(10); } }); }