@ConditionalOnMissingBean(value=org.springframework.batch.core.configuration.annotation.BatchConfigurer.class) @Configuration public class TaskExecutorBatchConfigurer extends Object implements org.springframework.batch.core.configuration.annotation.BatchConfigurer
DefaultBatchConfigurer, it only
introduces a TaskExecutor used in the
SimpleJobLauncher for starting jobs
asynchronously. Its thread pool is configured to four threads by default, which can be changed
by setting the property batch.max.pool.size to a different number.
The TaskExecutor may also be used in job configurations
for multi-threaded job execution. In XML you can use it by name, which is taskExecutor. In JavaConfig,
you can either autowire TaskExecutor or, if you want to know
where it's configured, this class.| Constructor and Description |
|---|
TaskExecutorBatchConfigurer() |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.batch.core.repository.JobRepository |
createJobRepository() |
org.springframework.batch.core.launch.JobLauncher |
getJobLauncher() |
org.springframework.batch.core.repository.JobRepository |
getJobRepository() |
org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
void |
initialize() |
void |
setDataSource(DataSource dataSource) |
org.springframework.core.task.TaskExecutor |
taskExecutor() |
@Bean public org.springframework.core.task.TaskExecutor taskExecutor()
@Autowired public void setDataSource(DataSource dataSource)
public org.springframework.batch.core.repository.JobRepository getJobRepository()
getJobRepository in interface org.springframework.batch.core.configuration.annotation.BatchConfigurerpublic org.springframework.transaction.PlatformTransactionManager getTransactionManager()
getTransactionManager in interface org.springframework.batch.core.configuration.annotation.BatchConfigurerpublic org.springframework.batch.core.launch.JobLauncher getJobLauncher()
getJobLauncher in interface org.springframework.batch.core.configuration.annotation.BatchConfigurerprotected org.springframework.batch.core.repository.JobRepository createJobRepository()
throws Exception
Exception@PostConstruct public void initialize() throws Exception
ExceptionCopyright © 2014. All Rights Reserved.