@Override public void schedule(final String beanName, final Boolean forceScheduling) { if (this.applicationContext.containsBean(beanName)) { final Scheduler scheduler = this.applicationContext.getBean(beanName, Scheduler.class); if (scheduler.getSchedulerStatus().equals(SchedulerStatus.RUNNING) && Boolean.FALSE.equals(forceScheduling)) { log.info("Scheduler: " + beanName + " already running"); } else { scheduler.schedule(); } } else { throw new SpringBatchLightminConfigurationException("Could not schedule bean with name: " + beanName); } }
@Override public void schedule(final String beanName, final Boolean forceScheduling) { if (this.applicationContext.containsBean(beanName)) { final Scheduler scheduler = this.applicationContext.getBean(beanName, Scheduler.class); if (scheduler.getSchedulerStatus().equals(SchedulerStatus.RUNNING) && Boolean.FALSE.equals(forceScheduling)) { log.info("Scheduler: " + beanName + " already running"); } else { scheduler.schedule(); } } else { throw new SpringBatchLightminConfigurationException("Could not schedule bean with name: " + beanName); } }
@Override public void terminate(final String beanName) { if (this.applicationContext.containsBean(beanName)) { final Scheduler scheduler = this.applicationContext.getBean(beanName, Scheduler.class); if (scheduler.getSchedulerStatus().equals(SchedulerStatus.STOPPED)) { log.info("Scheduler: " + beanName + " already terminated"); } else { scheduler.terminate(); } } else { throw new SpringBatchLightminConfigurationException("Could not terminate bean with name: " + beanName); } }
@Override public void terminate(final String beanName) { if (this.applicationContext.containsBean(beanName)) { final Scheduler scheduler = this.applicationContext.getBean(beanName, Scheduler.class); if (scheduler.getSchedulerStatus().equals(SchedulerStatus.STOPPED)) { log.info("Scheduler: " + beanName + " already terminated"); } else { scheduler.terminate(); } } else { throw new SpringBatchLightminConfigurationException("Could not terminate bean with name: " + beanName); } }
for (final Map.Entry<String, Scheduler> schedulerEntry : schedulerMap.entrySet()) { final Scheduler scheduler = schedulerEntry.getValue(); if (SchedulerStatus.RUNNING.equals(scheduler.getSchedulerStatus())) { log.debug("scheduling bean: " + schedulerEntry.getKey()); scheduler.schedule();
for (final Map.Entry<String, Scheduler> schedulerEntry : schedulerMap.entrySet()) { final Scheduler scheduler = schedulerEntry.getValue(); if (SchedulerStatus.RUNNING.equals(scheduler.getSchedulerStatus())) { log.debug("scheduling bean: " + schedulerEntry.getKey()); scheduler.schedule();
@Override public void updateJobConfiguration(final JobConfiguration jobConfiguration) { jobConfiguration.validateForUpdate(); try { final JobConfiguration existingJobConfiguration = this.jobConfigurationRepository.getJobConfiguration(jobConfiguration.getJobConfigurationId(), this.springBatchLightminCoreConfigurationProperties.getApplicationName()); if (existingJobConfiguration.getJobSchedulerConfiguration() != null) { final String existingBeanName = existingJobConfiguration.getJobSchedulerConfiguration().getBeanName(); jobConfiguration.getJobSchedulerConfiguration().setBeanName(existingBeanName); this.jobConfigurationRepository.update(jobConfiguration, this.springBatchLightminCoreConfigurationProperties.getApplicationName()); this.schedulerService.refreshSchedulerForJob(jobConfiguration); if (SchedulerStatus.RUNNING.equals(jobConfiguration.getJobSchedulerConfiguration().getSchedulerStatus())) { this.schedulerService.schedule(jobConfiguration.getJobSchedulerConfiguration().getBeanName(), Boolean.TRUE); } else { log.info("Scheduler not started, no scheduling triggered!"); } } else if (existingJobConfiguration.getJobListenerConfiguration() != null) { final String existingBeanName = existingJobConfiguration.getJobListenerConfiguration().getBeanName(); jobConfiguration.getJobListenerConfiguration().setBeanName(existingBeanName); this.jobConfigurationRepository.update(jobConfiguration, this.springBatchLightminCoreConfigurationProperties.getApplicationName()); this.listenerService.refreshListenerForJob(jobConfiguration); } } catch (final NoSuchJobConfigurationException e) { log.error(e.getMessage()); throw new SpringBatchLightminApplicationException(e, e.getMessage()); } }
@Override public void updateJobConfiguration(final JobConfiguration jobConfiguration) { jobConfiguration.validateForUpdate(); try { final JobConfiguration existingJobConfiguration = this.jobConfigurationRepository.getJobConfiguration(jobConfiguration.getJobConfigurationId(), this.springBatchLightminCoreConfigurationProperties.getApplicationName()); if (existingJobConfiguration.getJobSchedulerConfiguration() != null) { final String existingBeanName = existingJobConfiguration.getJobSchedulerConfiguration().getBeanName(); jobConfiguration.getJobSchedulerConfiguration().setBeanName(existingBeanName); this.jobConfigurationRepository.update(jobConfiguration, this.springBatchLightminCoreConfigurationProperties.getApplicationName()); this.schedulerService.refreshSchedulerForJob(jobConfiguration); if (SchedulerStatus.RUNNING.equals(jobConfiguration.getJobSchedulerConfiguration().getSchedulerStatus())) { this.schedulerService.schedule(jobConfiguration.getJobSchedulerConfiguration().getBeanName(), Boolean.TRUE); } else { log.info("Scheduler not started, no scheduling triggered!"); } } else if (existingJobConfiguration.getJobListenerConfiguration() != null) { final String existingBeanName = existingJobConfiguration.getJobListenerConfiguration().getBeanName(); jobConfiguration.getJobListenerConfiguration().setBeanName(existingBeanName); this.jobConfigurationRepository.update(jobConfiguration, this.springBatchLightminCoreConfigurationProperties.getApplicationName()); this.listenerService.refreshListenerForJob(jobConfiguration); } } catch (final NoSuchJobConfigurationException e) { log.error(e.getMessage()); throw new SpringBatchLightminApplicationException(e, e.getMessage()); } }
this.jobConfigurationRepository.update(addedJobConfiguration, this.springBatchLightminCoreConfigurationProperties.getApplicationName()); if (SchedulerStatus.RUNNING.equals(addedJobConfiguration.getJobSchedulerConfiguration().getSchedulerStatus())) { this.schedulerService.schedule(beanName, Boolean.TRUE); } else {
this.jobConfigurationRepository.update(addedJobConfiguration, this.springBatchLightminCoreConfigurationProperties.getApplicationName()); if (SchedulerStatus.RUNNING.equals(addedJobConfiguration.getJobSchedulerConfiguration().getSchedulerStatus())) { this.schedulerService.schedule(beanName, Boolean.TRUE); } else {