@Configuration
@EnableBatchProcessing(modular=true)
@PropertySource(value="classpath:spring-boot-starter-batch-web.properties")
@Import(value={WebConfig.class,TaskExecutorBatchConfigurer.class,AutomaticJobRegistrarConfiguration.class,BaseConfiguration.class,Jsr352BatchConfiguration.class,MetricsConfiguration.class,TaskExecutorConfiguration.class})
public class BatchWebAutoConfiguration
extends Object
implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>, org.springframework.core.Ordered
It enables batch processing, imports the batch infrastructure configuration (TaskExecutorBatchConfigurer and imports the web endpoint
configuration (WebConfig.
It also imports AutomaticJobRegistrarConfiguration which looks for jobs in a modular fashion, meaning that every job configuration file
gets its own Child-ApplicationContext. Configuration files can be XML files in the location /META-INF/spring/batch/jobs, overridable via property
batch.config.path.xml, and JavaConfig classes in the package spring.batch.jobs, overridable via property batch.config.package.javaconfig.
In addition to collecting jobs a number of default listeners is added to each job. The ProtocolListener adds
a protocol to the log. It is activated by default and can be deactivated by setting the property batch.defaultprotocol.enabled to false.
LoggingListener and LoggingAfterJobListener add a log file separation
per job run, are activated by default and can be deactivated by setting the property batch.logfileseparation.enabled to false. The
RunningExecutionTrackerListener is needed for knowing which JobExecutions are currently running on this node.
| Constructor and Description |
|---|
BatchWebAutoConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
AddListenerToJobService |
addListenerToJobService() |
int |
getOrder() |
LoggingAfterJobListener |
loggingAfterJobListener() |
LoggingListener |
loggingListener() |
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
ProtocolListener |
protocolListener() |
RunningExecutionTracker |
runningExecutionTracker() |
RunningExecutionTrackerListener |
runningExecutionTrackerListener() |
@Bean public LoggingListener loggingListener()
@Bean public LoggingAfterJobListener loggingAfterJobListener()
@Bean public ProtocolListener protocolListener()
@Bean public RunningExecutionTracker runningExecutionTracker()
@Bean public RunningExecutionTrackerListener runningExecutionTrackerListener()
@Bean public AddListenerToJobService addListenerToJobService()
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>public int getOrder()
getOrder in interface org.springframework.core.OrderedCopyright © 2016. All Rights Reserved.