转自http://www.cnblogs.com/slimer/p/6222485.html
主要要点,并行执行(多任务同时)
@Configuration
@EnableScheduling
public
class
ScheduleConfig
implements
SchedulingConfigurer {
@Override
public
void
configureTasks(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.setScheduler(taskExecutor());
}
@Bean
(destroyMethod=
"shutdown"
)
public
Executor taskExecutor() {
return
Executors.newScheduledThreadPool(
100
);
}
}