use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project open-smart-grid-platform by OSGP.
the class LightSwitchingOnConfig method lightSwitchingOnTaskScheduler.
@Bean(destroyMethod = "shutdown")
public TaskScheduler lightSwitchingOnTaskScheduler() {
final ThreadPoolTaskScheduler lightSwitchingOnTaskScheduler = new ThreadPoolTaskScheduler();
lightSwitchingOnTaskScheduler.setPoolSize(Integer.parseInt(this.environment.getRequiredProperty(PROPERTY_NAME_AUTONOMOUS_LIGHTSWITCHING_ON_POOL_SIZE)));
lightSwitchingOnTaskScheduler.setThreadNamePrefix(this.environment.getRequiredProperty(PROPERTY_NAME_AUTONOMOUS_LIGHTSWITCHING_ON_THREAD_NAME_PREFIX));
lightSwitchingOnTaskScheduler.setWaitForTasksToCompleteOnShutdown(false);
return lightSwitchingOnTaskScheduler;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project open-smart-grid-platform by OSGP.
the class TariffSwitchingHighConfig method tariffSwitchingHighTaskScheduler.
@Bean(destroyMethod = "shutdown")
public TaskScheduler tariffSwitchingHighTaskScheduler() {
final ThreadPoolTaskScheduler tariffSwitchingHighTaskScheduler = new ThreadPoolTaskScheduler();
tariffSwitchingHighTaskScheduler.setPoolSize(Integer.parseInt(this.environment.getRequiredProperty(PROPERTY_NAME_AUTONOMOUS_TARIFFSWITCHING_HIGH_POOL_SIZE)));
tariffSwitchingHighTaskScheduler.setThreadNamePrefix(this.environment.getRequiredProperty(PROPERTY_NAME_AUTONOMOUS_TARIFFSWITCHING_HIGH_THREAD_NAME_PREFIX));
tariffSwitchingHighTaskScheduler.setWaitForTasksToCompleteOnShutdown(false);
return tariffSwitchingHighTaskScheduler;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project open-smart-grid-platform by OSGP.
the class AutonomousDeviceRebootConfig method deviceRebootTaskScheduler.
@Bean(destroyMethod = "shutdown")
public TaskScheduler deviceRebootTaskScheduler() {
final ThreadPoolTaskScheduler deviceRebootTaskScheduler = new ThreadPoolTaskScheduler();
deviceRebootTaskScheduler.setPoolSize(Integer.parseInt(this.environment.getRequiredProperty(PROPERTY_NAME_AUTONOMOUS_DEVICE_REBOOT_POOL_SIZE)));
deviceRebootTaskScheduler.setThreadNamePrefix(this.environment.getRequiredProperty(PROPERTY_NAME_AUTONOMOUS_DEVICE_REBOOT_THREAD_NAME_PREFIX));
deviceRebootTaskScheduler.setWaitForTasksToCompleteOnShutdown(false);
return deviceRebootTaskScheduler;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project open-smart-grid-platform by OSGP.
the class Iec60870AsduGeneratorService method getThreadPoolTaskScheduler.
private ThreadPoolTaskScheduler getThreadPoolTaskScheduler() {
final ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
threadPoolTaskScheduler.setPoolSize(1);
threadPoolTaskScheduler.setThreadNamePrefix("ThreadPoolTaskScheduler");
threadPoolTaskScheduler.initialize();
return threadPoolTaskScheduler;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler in project fast_responder by Silwings-git.
the class ResponderWebConfigurer method httpTaskScheduler.
@Bean("httpTaskScheduler")
public TaskScheduler httpTaskScheduler(final TaskSchedulerProperties taskSchedulerProperties) {
final ThreadPoolTaskScheduler httpTaskScheduler = new ThreadPoolTaskScheduler();
// 因为该服务通常用于调试,http任务不会很多,默认设置核心线程数为1
httpTaskScheduler.setPoolSize(taskSchedulerProperties.getThreadPoolSize());
return httpTaskScheduler;
}
Aggregations