@Override public void schedule() { final Date initialDelay = new Date(System.currentTimeMillis() + this.jobSchedulerConfiguration.getInitialDelay()); log.debug("Scheduling: " + this.jobRunner.getJob().getName() + " with Parameters: " + this.jobRunner.getJobParameters().toProperties()); this.threadPoolTaskScheduler.scheduleWithFixedDelay(this.jobRunner, initialDelay, this.jobSchedulerConfiguration.getFixedDelay()); this.setStatus(SchedulerStatus.RUNNING); }
@Override public void schedule() { final Date initialDelay = new Date(System.currentTimeMillis() + this.jobSchedulerConfiguration.getInitialDelay()); log.debug("Scheduling: " + this.jobRunner.getJob().getName() + " with Parameters: " + this.jobRunner.getJobParameters().toProperties()); this.threadPoolTaskScheduler.scheduleWithFixedDelay(this.jobRunner, initialDelay, this.jobSchedulerConfiguration.getFixedDelay()); this.setStatus(SchedulerStatus.RUNNING); }
public static List<ValueRecord> map(final JobSchedulerConfiguration jobSchedulerConfiguration, final Long jobConfigurationId) { final List<ValueRecord> valueRecords = new ArrayList<>(); final ValueRecord beanName = new ValueRecord(jobConfigurationId, JobSchedulerConfigurationKey.BEAN_NAME, jobSchedulerConfiguration.getBeanName()); final ValueRecord cronExpression = new ValueRecord(jobConfigurationId, JobSchedulerConfigurationKey.CRON_EXPRESSION, jobSchedulerConfiguration.getCronExpression()); final ValueRecord fixedDelay = new ValueRecord(jobConfigurationId, JobSchedulerConfigurationKey.FIXED_DELAY, jobSchedulerConfiguration.getFixedDelay()); final ValueRecord initialDelay = new ValueRecord(jobConfigurationId, JobSchedulerConfigurationKey.INITIAL_DELAY, jobSchedulerConfiguration.getInitialDelay()); final ValueRecord schedulerStatus = new ValueRecord(jobConfigurationId, JobSchedulerConfigurationKey.STATUS, jobSchedulerConfiguration.getSchedulerStatus().getValue()); final ValueRecord schedulerType = new ValueRecord(jobConfigurationId, JobSchedulerConfigurationKey.SCHEDULER_TYPE, jobSchedulerConfiguration.getJobSchedulerType().getId()); final ValueRecord executorType = new ValueRecord(jobConfigurationId, JobSchedulerConfigurationKey.TASK_EXECUTOR_TYPE, jobSchedulerConfiguration.getTaskExecutorType().getId()); valueRecords.add(beanName); valueRecords.add(cronExpression); valueRecords.add(fixedDelay); valueRecords.add(initialDelay); valueRecords.add(schedulerStatus); valueRecords.add(schedulerType); valueRecords.add(executorType); return valueRecords; } }
private static JobSchedulerConfiguration map(final org.tuxdevelop.spring.batch.lightmin.domain.JobSchedulerConfiguration jobSchedulerConfiguration) { final JobSchedulerConfiguration response; if (jobSchedulerConfiguration != null) { response = new JobSchedulerConfiguration(); response.setCronExpression(jobSchedulerConfiguration.getCronExpression()); response.setFixedDelay(jobSchedulerConfiguration.getFixedDelay()); response.setInitialDelay(jobSchedulerConfiguration.getInitialDelay()); response.setJobSchedulerType(map(jobSchedulerConfiguration.getJobSchedulerType())); response.setSchedulerStatus(map(jobSchedulerConfiguration.getSchedulerStatus())); response.setTaskExecutorType(map(jobSchedulerConfiguration.getTaskExecutorType())); } else { response = null; } return response; }
private static JobSchedulerConfiguration map(final org.tuxdevelop.spring.batch.lightmin.domain.JobSchedulerConfiguration jobSchedulerConfiguration) { final JobSchedulerConfiguration response; if (jobSchedulerConfiguration != null) { response = new JobSchedulerConfiguration(); response.setCronExpression(jobSchedulerConfiguration.getCronExpression()); response.setFixedDelay(jobSchedulerConfiguration.getFixedDelay()); response.setInitialDelay(jobSchedulerConfiguration.getInitialDelay()); response.setJobSchedulerType(map(jobSchedulerConfiguration.getJobSchedulerType())); response.setSchedulerStatus(map(jobSchedulerConfiguration.getSchedulerStatus())); response.setTaskExecutorType(map(jobSchedulerConfiguration.getTaskExecutorType())); } else { response = null; } return response; }