List of usage examples for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor setThreadPriority
public void setThreadPriority(int threadPriority)
From source file:burstcoin.jminer.core.CoreConfig.java
/** * Reader pool.//from ww w . jav a 2 s .co m * * @return the thread pool task executor */ @Bean(name = "readerPool") public ThreadPoolTaskExecutor readerPool() { ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor(); pool.setThreadPriority(Thread.NORM_PRIORITY); // false-> triggers interrupt exception at shutdown pool.setWaitForTasksToCompleteOnShutdown(true); return pool; }
From source file:burstcoin.jminer.core.CoreConfig.java
/** * Network pool./* w w w. ja v a 2s. c o m*/ * * @return the thread pool task executor */ @Bean(name = "networkPool") public ThreadPoolTaskExecutor networkPool() { ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor(); pool.setMaxPoolSize(2); pool.setThreadPriority(Thread.NORM_PRIORITY + 1); return pool; }