committed by
Fadhel Mahmoud Ben Hassine
parent
d280556d02
commit
c0791039dc
@@ -22,7 +22,7 @@ import org.springframework.batch.core.configuration.BatchConfigurationException;
|
||||
import org.springframework.batch.core.explore.JobExplorer;
|
||||
import org.springframework.batch.core.explore.support.JobExplorerFactoryBean;
|
||||
import org.springframework.batch.core.launch.JobLauncher;
|
||||
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
|
||||
import org.springframework.batch.core.launch.support.TaskExecutorJobLauncher;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
@@ -133,7 +133,7 @@ public class DefaultBatchConfigurer implements BatchConfigurer, InitializingBean
|
||||
* creating the {@link JobLauncher}.
|
||||
*/
|
||||
protected JobLauncher createJobLauncher() throws Exception {
|
||||
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
|
||||
TaskExecutorJobLauncher jobLauncher = new TaskExecutorJobLauncher();
|
||||
jobLauncher.setJobRepository(this.jobRepository);
|
||||
jobLauncher.afterPropertiesSet();
|
||||
return jobLauncher;
|
||||
|
||||
@@ -26,10 +26,9 @@ import org.springframework.batch.core.configuration.JobRegistry;
|
||||
import org.springframework.batch.core.configuration.support.ApplicationContextFactory;
|
||||
import org.springframework.batch.core.configuration.support.AutomaticJobRegistrar;
|
||||
import org.springframework.batch.core.launch.JobLauncher;
|
||||
import org.springframework.batch.core.launch.support.TaskExecutorJobLauncher;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.beans.factory.UnsatisfiedDependencyException;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -102,7 +101,7 @@ import org.springframework.transaction.PlatformTransactionManager;
|
||||
* <li>a {@link JobRepository} (bean name "jobRepository" of type
|
||||
* {@link org.springframework.batch.core.repository.support.SimpleJobRepository})</li>
|
||||
* <li>a {@link JobLauncher} (bean name "jobLauncher" of type
|
||||
* {@link org.springframework.batch.core.launch.support.SimpleJobLauncher})</li>
|
||||
* {@link TaskExecutorJobLauncher})</li>
|
||||
* <li>a {@link JobRegistry} (bean name "jobRegistry" of type
|
||||
* {@link org.springframework.batch.core.configuration.support.MapJobRegistry})</li>
|
||||
* <li>a {@link org.springframework.batch.core.explore.JobExplorer} (bean name
|
||||
@@ -190,7 +189,7 @@ import org.springframework.transaction.PlatformTransactionManager;
|
||||
* </job>
|
||||
* <beans:bean id="transactionManager" .../>
|
||||
* <beans:bean id="jobLauncher" class=
|
||||
"org.springframework.batch.core.launch.support.SimpleJobLauncher">
|
||||
"org.springframework.batch.core.launch.support.TaskExecutorJobLauncher">
|
||||
* <beans:property name="jobRepository" ref="jobRepository" />
|
||||
* </beans:bean>
|
||||
* </batch>
|
||||
|
||||
@@ -62,9 +62,9 @@ import org.springframework.util.Assert;
|
||||
* @see JobRepository
|
||||
* @see TaskExecutor
|
||||
*/
|
||||
public class SimpleJobLauncher implements JobLauncher, InitializingBean {
|
||||
public class TaskExecutorJobLauncher implements JobLauncher, InitializingBean {
|
||||
|
||||
protected static final Log logger = LogFactory.getLog(SimpleJobLauncher.class);
|
||||
protected static final Log logger = LogFactory.getLog(TaskExecutorJobLauncher.class);
|
||||
|
||||
private JobRepository jobRepository;
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.batch.core.step.builder;
|
||||
import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.launch.JobLauncher;
|
||||
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
|
||||
import org.springframework.batch.core.launch.support.TaskExecutorJobLauncher;
|
||||
import org.springframework.batch.core.step.job.JobParametersExtractor;
|
||||
import org.springframework.batch.core.step.job.JobStep;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class JobStepBuilder extends StepBuilderHelper<JobStepBuilder> {
|
||||
step.setJobParametersExtractor(jobParametersExtractor);
|
||||
}
|
||||
if (jobLauncher == null) {
|
||||
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
|
||||
TaskExecutorJobLauncher jobLauncher = new TaskExecutorJobLauncher();
|
||||
jobLauncher.setJobRepository(getJobRepository());
|
||||
try {
|
||||
jobLauncher.afterPropertiesSet();
|
||||
|
||||
Reference in New Issue
Block a user