May 2015
Intermediate to advanced
234 pages
4h 18m
English
Some jobs need to be executed regularly-every night, every hour, and so on. Spring makes this easy with the @Scheduled annotation.
We will use the job defined in the Creating a job recipe.
Follow these steps to schedule the job:
getServletConfigClasses()method in your class extending AbstractAnnotationConfigDispatcherServletInitializer:public class ServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class<?>[]{AppConfig.class, BatchConfig.class};
}@EnableScheduling annotation to the Spring Batch configuration class:@Configuration ...
Read now
Unlock full access