@Override public final FlowJob getObject() throws Exception { Assert.isTrue(StringUtils.hasText(name), "The job must have an id."); FlowJob flowJob = new FlowJob(name); if (restartable != null) { flowJob.setRestartable(restartable); } if (jobRepository != null) { flowJob.setJobRepository(jobRepository); } if (jobParametersValidator != null) { flowJob.setJobParametersValidator(jobParametersValidator); } if (jobExecutionListeners != null) { flowJob.setJobExecutionListeners(jobExecutionListeners); } if (jobParametersIncrementer != null) { flowJob.setJobParametersIncrementer(jobParametersIncrementer); } if (flow != null) { flowJob.setFlow(flow); } flowJob.afterPropertiesSet(); return flowJob; }
public void registerListener(final Job job) { if (job != null) { try { if (job instanceof SimpleJob) { final SimpleJob simpleJob = (SimpleJob) job; final JobExecutionListener[] jobExecutionListeners = this.getJobExecutionListeners(); simpleJob.setJobExecutionListeners(jobExecutionListeners); } else if (job instanceof FlowJob) { final FlowJob flowJob = (FlowJob) job; final JobExecutionListener[] jobExecutionListeners = this.getJobExecutionListeners(); flowJob.setJobExecutionListeners(jobExecutionListeners); } else { throw new SpringBatchLightminApplicationException("Could not cast" + job + "to org.springframework.batch.core.job.SimpleJob or " + "org.springframework.batch.core.job.FlowJob"); } } catch (final Exception e) { log.error("Could not cast {} to org.springframework.batch.core.job.SimpleJob or " + "org.springframework.batch.core.job.FlowJob", job); } } else { throw new SpringBatchLightminApplicationException("Could not register listener for a null job"); } }
public void registerListener(final Job job) { if (job != null) { try { if (job instanceof SimpleJob) { final SimpleJob simpleJob = (SimpleJob) job; final JobExecutionListener[] jobExecutionListeners = this.getJobExecutionListeners(); simpleJob.setJobExecutionListeners(jobExecutionListeners); } else if (job instanceof FlowJob) { final FlowJob flowJob = (FlowJob) job; final JobExecutionListener[] jobExecutionListeners = this.getJobExecutionListeners(); flowJob.setJobExecutionListeners(jobExecutionListeners); } else { throw new SpringBatchLightminApplicationException("Could not cast" + job + "to org.springframework.batch.core.job.SimpleJob or " + "org.springframework.batch.core.job.FlowJob"); } } catch (final Exception e) { log.error("Could not cast {} to org.springframework.batch.core.job.SimpleJob or " + "org.springframework.batch.core.job.FlowJob", job); } } else { throw new SpringBatchLightminApplicationException("Could not register listener for a null job"); } }
public final Object getObject() throws Exception { Assert.isTrue(StringUtils.hasText(name), "The job must have an id."); FlowJob flowJob = new FlowJob(name); if (restartable != null) { flowJob.setRestartable(restartable); } if (jobRepository != null) { flowJob.setJobRepository(jobRepository); } if (jobParametersValidator != null) { flowJob.setJobParametersValidator(jobParametersValidator); } if (jobExecutionListeners != null) { flowJob.setJobExecutionListeners(jobExecutionListeners); } if (jobParametersIncrementer != null) { flowJob.setJobParametersIncrementer(jobParametersIncrementer); } if (flow != null) { flowJob.setFlow(flow); } flowJob.afterPropertiesSet(); return flowJob; }
@Override public final FlowJob getObject() throws Exception { Assert.isTrue(StringUtils.hasText(name), "The job must have an id."); FlowJob flowJob = new FlowJob(name); if (restartable != null) { flowJob.setRestartable(restartable); } if (jobRepository != null) { flowJob.setJobRepository(jobRepository); } if (jobParametersValidator != null) { flowJob.setJobParametersValidator(jobParametersValidator); } if (jobExecutionListeners != null) { flowJob.setJobExecutionListeners(jobExecutionListeners); } if (jobParametersIncrementer != null) { flowJob.setJobParametersIncrementer(jobParametersIncrementer); } if (flow != null) { flowJob.setFlow(flow); } flowJob.afterPropertiesSet(); return flowJob; }
@Override public final FlowJob getObject() throws Exception { Assert.isTrue(StringUtils.hasText(name), "The job must have an id."); FlowJob flowJob = new FlowJob(name); if (restartable != null) { flowJob.setRestartable(restartable); } if (jobRepository != null) { flowJob.setJobRepository(jobRepository); } if (jobParametersValidator != null) { flowJob.setJobParametersValidator(jobParametersValidator); } if (jobExecutionListeners != null) { flowJob.setJobExecutionListeners(jobExecutionListeners); } if (jobParametersIncrementer != null) { flowJob.setJobParametersIncrementer(jobParametersIncrementer); } if (flow != null) { flowJob.setFlow(flow); } flowJob.afterPropertiesSet(); return flowJob; }
@Override public final FlowJob getObject() throws Exception { Assert.isTrue(StringUtils.hasText(name), "The job must have an id."); FlowJob flowJob = new FlowJob(name); if (restartable != null) { flowJob.setRestartable(restartable); } if (jobRepository != null) { flowJob.setJobRepository(jobRepository); } if (jobParametersValidator != null) { flowJob.setJobParametersValidator(jobParametersValidator); } if (jobExecutionListeners != null) { flowJob.setJobExecutionListeners(jobExecutionListeners); } if (jobParametersIncrementer != null) { flowJob.setJobParametersIncrementer(jobParametersIncrementer); } if (flow != null) { flowJob.setFlow(flow); } flowJob.afterPropertiesSet(); return flowJob; }